Repository navigation
feat(parity): lane 5 parity gate, legacy-dark soak checks, F6 corpus and GPU paired-run gates - #22426
Conversation
…d GPU paired-run gates Lane 5 of the legacy-retire swarm (M1 slice): - scripts/parity/parity_gate.py: rows 1-8 of contract (j) on --surface staging and --surface prod-shadow (rows 3-6 gate ladder ADVANCE), parity_report.json, PARITY_PASS/FAIL/PENDING last line, data_loss for rows 5/7 (ROLLBACK_ZERO). - scripts/parity/soak_check.py: the ten 12h legacy-dark soak checks; the lost-recording census must start at draining; all four legacy queues including sync-backfill-fresh; read-only live collectors. - scripts/parity/fleet_sample.py: rows 3/4 from the fleet gate's JSON sample (strict 121s dispatch breach) and the gate's data-loss tokens. - testing/quality_corpus: pinned public corpus (AMI/LibriSpeech/VoxConverse + silence), production-chain runner, scorer, and the paired runs gating #22368 (flight batching: qualify receipt re-verified plus chain pair) and #22358 (short-speech skip: fired units vs full diarizer), with an L4 Job template for staging. No GCP access in tests; reports carry aggregates and opaque keys only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er the CPU guard Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c598870456
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| surface, | ||
| corpus=_load_json(args.corpus_scores), | ||
| replay=replay, | ||
| gate_sample=gate_sample, |
There was a problem hiding this comment.
Honor the parsed fleet verdict
When the captured fleet output ends in GATE_FAIL or GATE_PENDING, this call passes only the last JSON sample into evaluate; gate_status, gate_reason, and the computed data-loss token are merely copied into metadata. A sample whose row aggregates look healthy can therefore produce PARITY_PASS with data_loss=false even when the fleet gate rejected it for reasons such as projection_error, allowing the production ladder to advance instead of rolling back.
Useful? React with 👍 / 👎.
| cp /scripts/$f.py /app/scripts/parity/ 2>/dev/null || true | ||
| done | ||
| export PYTHONPATH=/app QUALITY_CORPUS_CACHE=/corpus BATCH_PIPELINE_MODEL_BATCH_SIZE=8 | ||
| python testing/quality_corpus/corpus.py fetch --cache /corpus |
There was a problem hiding this comment.
Commit the checksum lock before running the Job
This command invokes fetch without --pin, but fetch raises CorpusError for every source absent from manifest.lock.json; a repository-wide git ls-tree check confirms that this commit contains no such lock file. Consequently every advertised short-speech, flight, and baseline Job stops here after downloading the corpus and can never reach its paired run.
Useful? React with 👍 / 👎.
| if not path.exists(): | ||
| missing += 1 | ||
| continue |
There was a problem hiding this comment.
Fail scoring when a corpus unit is absent
If either pipeline omits an output file, this silently excludes the unit from WER and speaker scoring while corpus_minutes still reports the full reference corpus duration. Since the parity rows never reject the emitted missing_units count, a pipeline that processed only an easy subset can satisfy the 60-minute floor and pass against a different subset from the other pipeline; missing outputs should make the score invalid or be counted as empty hypotheses.
Useful? React with 👍 / 👎.
| if 'silence' in meta['use']: | ||
| silence_words += len(words) |
There was a problem hiding this comment.
Gate on hallucinations in silence units
Although the corpus explicitly includes silence to detect hallucinations, inserted words are only accumulated into silence_inserted_words; none of the parity row evaluators reads that field. Thus a batch pipeline can emit arbitrary text for every silence clip and still receive PARITY_PASS, so a nonzero count needs to affect the corpus verdict.
Useful? React with 👍 / 👎.
| python -c 'import json,sys; r=json.load(open(sys.argv[1])); print("\n".join("SPEAKER x 1 %.3f %.3f <NA> <NA> %s <NA> <NA>" % (t["start"], t["end"]-t["start"], t["speaker"]) for t in r["turns"]))' "$u" > /corpus/built/$id.rttm | ||
| set -- "$@" --pair /corpus/built/units/$id.wav:/corpus/built/$id.rttm | ||
| done | ||
| python testing/quality_corpus/paired_short_speech.py "$@" --output /receipts/short-speech.json || echo "exit=$?" |
There was a problem hiding this comment.
Preserve paired-gate failures as Job failures
The short-speech command's nonzero gate result is converted to a successful echo result, and the flight branch repeats the same pattern. Because the script then reaches the successful sleep, Kubernetes marks the Job succeeded even when either paired-run gate reports failure or insufficient evidence, so automation or an operator relying on Job status can promote a rejected experiment.
Useful? React with 👍 / 👎.
| if breaches is None: | ||
| return _check('first_summary', PENDING, 'input_invalid', measured) | ||
| if breaches or sample.get('first_summary_status') == 'FAIL': | ||
| return _check('first_summary', FAIL, 'first_summary_dispatch_contract', measured) | ||
| return _check('first_summary', PASS, 'pass', measured) |
There was a problem hiding this comment.
Require measured first-summary traffic before passing
A fleet sample with first_summary_dispatch_breaches=0 passes this check even when first_summary_dispatch_measured_count is zero or absent and first_summary_status is unmeasured or NO_WORK. This contradicts the soak contract that unmeasured evidence remains pending and can let the report pass without exercising the first-summary dispatch path; require a positive sample and a measured passing status.
Useful? React with 👍 / 👎.
| # increase() on a counter can return small fractions; any visible increase is a creation. | ||
| if value >= 0.5: | ||
| return _check('legacy_admissions', FAIL, 'legacy_admission_in_dark', measured) |
There was a problem hiding this comment.
Fail on every positive legacy-admission increase
The comment correctly notes that Prometheus increase() may return fractional counter increases and that any visible increase represents a legacy admission, but the implementation passes values below 0.5. During a boundary-extrapolated window where a real admission appears as a smaller positive fraction, this marks the data-loss check PASS and can complete the dark soak despite legacy work still being admitted.
Useful? React with 👍 / 👎.
| fired_bursts = by_kind['burst_same']['fired'] + by_kind['burst_diff']['fired'] | ||
| if failures: | ||
| status = 'fail' | ||
| elif len(fired) < min_fired or fired_bursts < min_fired_bursts: | ||
| status = 'insufficient_evidence' |
There was a problem hiding this comment.
Require fired different-speaker burst evidence
The evidence floor combines burst_same and burst_diff, so the short-speech gate can pass with 50 same-speaker bursts and zero fired adversarial different-speaker bursts. Since different-speaker bursts separated by at most 0.5 seconds are the case that can make the shortcut collapse two speakers into one, absence of fired evidence for that category should leave the gate insufficient rather than enable the flag.
Useful? React with 👍 / 👎.
| reviewed = reviewed or {} | ||
| reviewed_keys = set(reviewed) | {opaque_key(k) for k in reviewed} |
There was a problem hiding this comment.
Validate explanation references for reviewed outliers
Only the keys of --reviewed-outliers are inspected, so values that are empty, null, or otherwise not explanation references still waive every matching WER outlier. A file such as {"conversation": ""} therefore converts an otherwise hard row-1b failure into reviewed evidence without the documented audit reference; validate that the input is a mapping with a nonempty reference for each waived key.
Useful? React with 👍 / 👎.
| def check_first_summary(sample: Mapping[str, Any] | None): | ||
| if not sample: | ||
| return _check('first_summary', PENDING, 'input_missing') | ||
| breaches = _cnt(sample, 'first_summary_dispatch_breaches') |
There was a problem hiding this comment.
Apply the strict dispatch limit during the soak
This check looks only at the fleet gate's breach counter, which the adapter documentation says uses the gate's looser 125-second tolerance, and never inspects first_summary_dispatch_max_seconds. A sample with a 123-second dispatch and zero fleet breaches therefore passes the soak even though the parity contract's strict 121-second limit is violated.
Useful? React with 👍 / 👎.
Summary
Swarm lane 5, M1 slice (legacy-sync retirement). It targets
integration/legacy-retire.scripts/parity/parity_gate.pyis contract (j) as an executable verdict. It evaluates rows 1, 1b, 2–8 on--surface staging(the M2 verdict) and on--surface prod-shadow, where rows 3–6 gate ladder ADVANCE from 25% per contract (g).parity_report.json. The last line isPARITY_PASS,PARITY_FAIL <reason>orPARITY_PENDING <reason>, with exit codes 0, 1 or 3.data_loss=truewhen row 5 or row 7 fails, which maps to ROLLBACK_ZERO.scripts/parity/soak_check.pyimplements the ten 12h legacy-dark soak checks from contract (h).draining.sync-backfill-fresh.scripts/parity/fleet_sample.pybuilds rows 3 and 4 from the workspace fleet gate's JSON sample. Dispatch breaches use the contract's strict 121s limit.testing/quality_corpus/holds the F6 parity subset:load_workerwith in-memory artifacts);Verification
bash test.shontests/unit/test_parity_gate.py,test_soak_check.pyandtest_quality_corpus_paired_runs.py: 55 passed. These are unit tests only.Not yet run: no GPU run and no GCP read. Both are scheduled on staging.
Product invariants affected
none
Failure-Class: none
🤖 Generated with Claude Code