chadyuk's picture
sample-level truth by counterfactual replay: README, index and the xs latent corpora
000d98e verified
|
Raw History Blame Contribute Delete
3.89 kB

Sample-level ground truth by counterfactual replay

One file per latent corpus and grain, <instance>/latent/seed=<k>/seqtruth-forced-ok-counterfactual-<request|session>.json: 25 corpora × 2 grains = 50 files. index.json lists every file with its size, its sha256 and its counts.

The files are derived from the latent corpora under instances/ (tool version 0.3.0). They sit outside the corpus folders, so every corpus still verifies against its own manifest.json. Licence: CC BY 4.0, as the corpora.

What a file holds

The truth edges of the sample-level graph of every sampled test trace of one corpus at one grain. A truth edge joins two failed attempts of one request. It is decided by counterfactual replay: the simulator re-runs the request with the earlier attempt set to ok and every random draw unchanged. The pair is a but-for edge if the outcome of the later attempt changes. It is a contingent edge if it is not a but-for edge and the outcome changes once the other failed callees of the same caller are set to ok in both runs. At the session grain the client's error record of a request is also a target of that request's BFF attempt. Pairs whose target succeeded, pairs across requests, and pairs between two client attempts of one journey step are not scored.

The traces are the test sample of the reference evaluation (read names the run): the test split in completion order (ordering: end), at most max_len tokens per trace, pairs at most max_lag positions apart.

Format

Header:

  • corpus_id, grain, split, read, ordering, c, max_len, max_lag: the corpus and the sample.
  • counts: sequences (sampled traces), sequences_with_candidates (traces with a scored pair), sequences_with_truth (traces with a truth edge), candidates (scored pairs), truth_directed (truth edges). The *_landed counts refer to a truth read from the recorded parent of each span; they are kept for comparison and are not the truth of this file.
  • directed_pairs: the truth edges by kind (single = but-for, contingent_only = contingent; by source; by whether the call is critical; by whether the two event types are an edge of the population-level summary graph).
  • dropped_candidates: pairs left out of the scored pairs (ok_target, client_retry, unmapped).
  • mapping, reruns, rerun_pairs_not_scored, old_against_new: bookkeeping of the build. oracle_check gives, per re-run shard, the number of client records, hops and sessions that were compared with the corpus's oracle tables.

sequences, one entry per sampled trace:

  • seq, trace_id: the trace's index in the sample and its identifier in the corpus's views.
  • length: positions of the stored sequence: a start marker, the trace's tokens (at most max_len), an end marker.
  • healthy: true when the trace has no failed attempt.
  • req: one entry per window index t = 0 … length − c − 1, the request identifier (as in the corpus's oracle tables) of the token at that index; null for the end marker and for a position that no request could be assigned to. Window index t is token number c + t − 1 of the trace, counting from 0.
  • pairs: lists in the order of pair_fields: j, q (window indices of the source and the target, j < q); column (directed: a truth edge; ancestor: another failed attempt of the request that changes under the same replay, not a truth edge); single (true: but-for); contingent (true: the target changes with the caller's other failed callees set to ok); source (final: the callee's last attempt; attempt0: a first attempt that was retried; edge: the BFF attempt, with the client's error record as target); critical (whether the call is critical; null for the client pair); token_j, token_q (the two tokens, so that the indexing can be checked).