Skip to content

feat(parity): lane 5 parity gate, legacy-dark soak checks, F6 corpus and GPU paired-run gates - #22426

Merged
Git-on-my-level merged 2 commits into
integration/legacy-retirefrom
lr/05-parity
Oct 19, 2026
Merged

Git-on-my-level merged 2 commits into
integration/legacy-retirefrom
lr/05-parity

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Swarm lane 5, M1 slice (legacy-sync retirement). It targets integration/legacy-retire.

  • scripts/parity/parity_gate.py is 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).
    • It writes parity_report.json. The last line is PARITY_PASS, PARITY_FAIL <reason> or PARITY_PENDING <reason>, with exit codes 0, 1 or 3.
    • data_loss=true when row 5 or row 7 fails, which maps to ROLLBACK_ZERO.
    • A missing input always makes a row PENDING. It never counts as a PASS.
  • scripts/parity/soak_check.py implements the ten 12h legacy-dark soak checks from contract (h).
    • The lost-recording census must start at draining.
    • It covers all four legacy queues, including sync-backfill-fresh.
    • Optional collectors are read-only.
  • scripts/parity/fleet_sample.py builds 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:

Verification

bash test.sh on tests/unit/test_parity_gate.py, test_soak_check.py and test_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

View guided diff Turn on auto-fix

Git-on-my-level and others added 2 commits October 19, 2026 13:27
…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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T07:23:57.663582Z c598870 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +218 to +220
if not path.exists():
missing += 1
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +224 to +225
if 'silence' in meta['use']:
silence_words += len(words)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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=$?"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +234 to +238
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +134 to +136
# 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +155 to +159
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'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +107 to +108
reviewed = reviewed or {}
reviewed_keys = set(reviewed) | {opaque_key(k) for k in reviewed}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +225 to +228
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')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 80f3ea5 into integration/legacy-retire Oct 19, 2026
25 checks passed
@Git-on-my-level
Git-on-my-level deleted the lr/05-parity branch October 19, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant