Repository navigation
Gate SPE5 Case 1 on acceptance bands and a scorecard row against JutulDarcy (#183) - #184
Conversation
…card row (#183) The spe5_shut_in comparison against the matched-interval JutulDarcy fixture was a diagnostic only: --check refused it and nothing compared its numbers to a limit. A manifest diagnostic can now opt in with `scored`, which lets it be selected alone with --check or --write-scorecard and merges its entry into the shared scorecard. A complete `records` run (CI) keeps that entry without requiring it, because the replay takes ~20 min. The scorecard entry stores the worst producer oil-rate, GOR, pore-volume-weighted pressure and water-cut differences (summary.*) and the stop agreement (stop.reports, stop.reason_differs) beside the cell-33 fields and the work counts. New BANDS: the summary metrics use the existing 25% relative allowance with absolute floors matching `p`/`sw` (0.05 bar, 0.002); the stop is discrete and ratcheted exactly. The manifest entry also declares absolute acceptance bands, checked whenever the diagnostic runs: oil rate 3%, GOR 1.5%, PV-weighted pressure 0.3 bar, water cut 0.005, stops at most one report apart and on the same condition. Justification: each is 1.5-2x the matched-interval ResSim-JutulDarcy difference measured on 03e1281 (2.00%, 0.86%, 0.173 bar, 0.00216, +0 reports) and well below either simulator's own interval-vs-0.5 d time-step error (6.1-7.7% in oil rate and GOR, 0.38-0.47 bar, 0.013-0.015 in water cut), so a breach is an engine disagreement rather than a resolution difference. No existing band moves. `validate-compositional.sh spe5` runs the replay, exports the record and checks both; `update-scorecard-spe5` writes the entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The block said one gate was local only because CI has no Flow, but it lists five commands: --grid-refine and validate-compositional.sh records need no Flow, and PR CI runs records inside benchmarks.sh check --tier fast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Written by bash scripts/validate-compositional.sh update-scorecard-spe5 on 5be5522 (clean): 1239 reports to the water-cut shut-in at 6285.34375 d on both sides, +0 reports. Worst vs JutulDarcy: oil rate 2.00%, GOR 0.86%, PV-weighted pressure 0.1726 bar, water cut 0.00218; 1239 steps, 6226 Newton, 0 failed. All within the acceptance bands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--check printed the top-level provenance, which describes only the last write. After a compositional or SPE5 write, a black-oil check said its baselines were 'measured at <commit>, no black-oil Flow'. The header now names the per-case measured blocks of the cases it checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#183) docs/SPE5_VALIDATION.md states the bands, their justification and the 5be5522 measurement, marks reference-plan item 4 done and gives the spe5 gate in Reproducer and gates. ROADMAP §4a item 2 links #183. The withheld-scenario comment and the SPE5 method reference no longer say the scorecard row is missing, and the comment no longer says SPE3 fails at 4109 d: it completes 15 years since #164. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing (#183) Review of #184 (Codex) found three ways the scored-diagnostic gate could report success with a check missing: - An explicit --check of a scored diagnostic whose scorecard row was removed called it ungated and exited 0. The row, each run and a baseline for every metric it measures are now required. - An acceptance block reduced to a comment printed 'acceptance check: OK'. A scored diagnostic's block must now band every summary difference, the stop's report distance and its condition; unknown keys, bad values and a missing block are refused before the comparison. - The records coverage exemption covered every diagnostic, so listing a graded case as an unscored diagnostic dropped it silently. Only scored diagnostics are exempt. The Flow-change note also used the top-level provenance, which after a compositional write says Flow None for a black-oil row; it now uses the row's own measured block, like the header. A --check now reports both the acceptance bands and the ratchet before failing; a write still stops at a breach. The stop's day difference is printed beside its report band, unbanded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stablish (#183) Review of #184 (Codex): - The stop band counts reports, and a stop between reports counts as the report that ends its interval, so one report apart allows up to two intervals (< 10.15 d) between the stop days. Drop the stated 5.07 d equivalence and explain the rule. - A breach establishes a larger gap under the replay settings, not that the engines disagree: matched reports still leave each simulator its own internal steps, and the 0.5 d pair moved both stops by one report. - Say that a missing scorecard row, missing baseline or incomplete bands block fails the gate, and drop the stale claim that the shared scorecard is still to do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review round (Codex review of 1. P1: the gate could pass with a check missing. Fixed.
2. P2: 3. P2: the stop band claimed 5.07 d. Fixed as you suggested. The report-index rule stays, and the 5.07 d equivalence is gone from the doc and the PR body.
4. P2: the rationale overstated a breach. Fixed in 5. P3: the Flow-change note used top-level provenance. Fixed. It now uses the row's own Validation on
Not rerun: the fresh ~15–20 min Tracking.
|
…183) Review of #184 (Codex): `scored` exempts a case from complete-run coverage, and a quoted "false" is truthy in Python, so relisting a graded case as a diagnostic with "scored": "false" dropped it from records without a word. The manifest reader now refuses any value but true or false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #184 (Codex): every comparison with NaN is false and nothing exceeds infinity, so a baseline of 1e309, Infinity or NaN (all accepted by Python's JSON reader) let a 10 bar regression pass --check, and so would a NaN measurement. judge() now fails when either side is not a finite number. Applies to every scorecard case, not only SPE5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #184 (Codex): the water-cut band is 2.29x its measured difference, so the four trajectory bands span 1.5-2.3x, not 1.5-2x. No band value changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Second review round (Codex re-review of 1. P2: a quoted 2. P2: a non-finite value disabled the ratchet. Fixed in
Evidence corrections.
Validation on
Not rerun: the fresh SPE5 replay, for the same reason as before; the engine and gate script are unchanged. |
Review of #184 (Codex): --write-scorecard wrote whatever it measured, so a 1e309 Newton count passed the acceptance bands and became the baseline, after which the unmodified replay failed its check. The write now refuses any run metric or invariant-pair value that --check would refuse, prints them and exits 1 with the scorecard untouched; json.dumps(allow_nan=False) is the backstop. The finite test is shared with the ratchet. Applies to every scorecard write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Third review round (Codex re-review of P2:
Test:
Validation on
Not rerun: |
What and why
This finishes item 2 of the SPE5 order in #52: SPE5 Case 1 now has a gated row against the matched-interval JutulDarcy fixture (
opm/compositional/spe5/shut_in/reference.json), compared through the earlier of the two shut-ins.Before this,
compare_small_direct.py --case spe5_shut_inwas a diagnostic only.--checkrefused it, and none of its numbers was compared to a limit.tools/opm_flow/compare_small_direct.py):"scored": true. It can then be selected alone with--checkor--write-scorecard, and its entry merges into the shared scorecard.--prune-scorecardis refused.recordsmode CI runs) keeps that entry but does not require it, because the replay takes ~15–20 min. A graded case that goes missing still fails coverage.summary.*: the worst producer oil-rate, GOR, pore-volume-weighted pressure and water-cut differences.stop.reportsandstop.reason_differs.BANDSentries for them; no existing band changes.spe5_shut_inentry ofopm/compositional/trajectory_cases.json. They are checked whenever the diagnostic runs and printed beside the measured values; a breach exits non-zero and is never written as a baseline. A scored diagnostic's block must band all four summary differences, the stop's report distance and its condition, or the comparator refuses it before comparing.--checkof a scored diagnostic fails when its scorecard entry, a run, or the baseline of any metric it measures is missing.bash scripts/validate-compositional.sh spe5runs the replay, exports the record, and checks the bands and the scorecard entry.update-scorecard-spe5writes the entry. Both fail when the replay fails or writes nothing.update-scorecard-spe5on clean5be5522e, and documented indocs/SPE5_VALIDATION.md→ "Acceptance bands and scorecard row (Gate SPE5 Case 1 against the matched-interval JutulDarcy fixture: acceptance bands and a scorecard row #183)".5be5522e)No engine code changes.
Closes #183. Refs #52.
Decisions I made on the owner's behalf (from #183's "Decisions for the owner")
You approved shaping and building in the session. I used the issue's recommended values; each is easy to change in review.
spe5gate.pandsw.src/lib/compositional/runSeries.ts). Switching it moves a number users see. It belongs with the Figure 12 overlay in Roadmap: run SPE5, then SPE3, live on the compositional engine #52 item 3, and the docs say so.Validation
cd tools/opm_flow && uv run --with pytest --with numpy python -m pytest -q220 passed, 55 subtests passed. The review tests fail on the head before them, excepttest_a_breach_is_never_written_as_a_baseline, which guards the restructured write path; the old comparator already refused that write. Before review:213 passed, 14 subtests passed. Seven newScoredShutInTests: bands printed and passing; each kind of breach failing (pressure, oil, stop, unmeasured, different condition, no trajectory); merge and ratchet into the shared scorecard; exact stop ratchet;recordscoverage not requiring the diagnostic but still failing on a missing graded case; prune refused. The existing test that an unscored diagnostic cannot--checkstill passes.SPE5_GATE_OUT=… bash scripts/validate-compositional.sh update-scorecard-spe5on5be5522eacceptance check: OK,compositional gate 'update-scorecard-spe5': OK. 1239 steps, 0 failed, 6226 Newton, 816 s.0c110a44(master, same engine) + manual export/comparecf5e40fdreplay (--case spe5_shut_in --check)acceptance check: OK,cross-solver check: OK; every measured metric has a baseline. The engine and gate script are unchanged sincecf5e40fd, so the 1114 s replay below was not repeated.bash scripts/validate-compositional.sh spe5oncf5e40fdcf5e40fd:acceptance check: OK,cross-solver check: OKagainst the recorded baseline, no regressions or improvements;compositional gate 'spe5': OK(replay 1114 s, with other work running).bash scripts/validate-compositional.sh records(rerun on the review head)cross-solver check: OK,compositional gate 'records': OK.spe5_shut_inis listed as kept, not measured.bash scripts/validate-compositional.sh thermo(rerun on the review head)compositional gate 'thermo': OKbash scripts/validate-cross-solver.sh(flow 2026.10, rerun on the review head)Inventory check: OK,cross-solver check: OKbash scripts/benchmarks.sh check --tier fast(rerun on the review head)benchmark check: OK,benchmark pages: in sync with their recordspnpm exec vitest run src/lib/catalog,pnpm run typecheck,pnpm run lintNot run:
pnpm run validate:productandvalidate-solver-coverage.sh: no Rust or frontend logic changed, only a scenario's method-reference string and a comment.validate-native-binding.sh: no payload boundary change.Also fixed
fix(opm):--checkprinted the scorecard's top-level provenance, which describes only the last write. After this PR's SPE5 write, a black-oil check would have said its baselines were "measured at 5be5522, no black-oil Flow". The header, and (after review) the "Flow itself changed" note, now use each checked case's ownmeasuredblock. Covered by a test that checks a preserved black-oil row after a compositional write.docs(readme): the local-gates block said "one gate is local only, because CI has no OPM Flow" but listed several commands.--grid-refineandrecordsneed no Flow, and PR CI runsrecordsinsidebenchmarks.sh check --tier fast.The withheld-scenario comment in
src/lib/catalog/scenarios.tsstill said SPE3 fails at 4109 d, but it completes 15 years since SPE3 fails at 4109 d: separator stability trial converged to roundoff but its trial sum never stops moving by 1e-14 #164. It and the SPE5 method reference also said the scorecard row was missing.fix(opm), from review: the scorecard ratchet passed any regression against a non-finite baseline (1e309,Infinity,NaN), and a NaN measurement passed too.judge()now fails when either side is not a finite number, for every scorecard case. Test:test_a_non_finite_value_never_passes_the_ratchet.--write-scorecardlikewise refuses to write a non-finite measured value and leaves the scorecard untouched. Test:test_a_non_finite_measurement_is_never_written.Follow-up issues
None filed. #157's acceptance looks met since #182 (the replay completes 15 years and the record is in
docs/SPE3_VALIDATION.md), but it is still open. Closing it is the owner's call.🤖 Generated with Claude Code