[TF24 hydraulics] Score the scenario gateway on two axes, not a match rate (#572) - #583
Open
dfalster wants to merge 1 commit into
Open
[TF24 hydraulics] Score the scenario gateway on two axes, not a match rate (#572)#583dfalster wants to merge 1 commit into
dfalster wants to merge 1 commit into
Conversation
classify_scm_run() calls a run a success on `finite && total > 0`. With
birth_rate = 1 -- what build_scenario() sets -- offspring_production IS R0, so
that is a far weaker test than it looks: at the blessed baseline five of the
eight hydraulic scenarios return R0 between 2e-15 and 6e-14, numerically
extinct, and every one was recorded as "persisted". All eight "succeeded", none
of the five expected failures failed, and only one replaced itself. The gateway
was returning no signal.
Implements options 3 + 1 from the issue: report both axes and make persistence
the primary ecological metric, without rewriting the CSV or re-blessing the
baseline.
* Numerical viability -- n_ran / n_crashed / viability_rate. Keeps meaning
what the CSV's "Model failure" means (#549, #550), and is the gate the
hydraulic/NSC work targets. Counted from the recorded `crashed` flag, so an
expected failure that crashes counts against viability while still counting
for agreement.
* Ecological persistence -- n_persists / persistence_rate, at R0 >= 1 via
persists_at() (added in #570).
* CSV agreement -- n_match / match_rate still reported, but no longer the
headline anywhere. With the crashes fixed (#546/#552/#554) it mostly
measures how well the CSV's crash predictions have aged: fixing the model
*lowered* it from 5/8 to 3/8, and that inversion is what showed the metric
was pointing the wrong way round.
status and outcome are untouched, so the blessed-baseline diff is still defined
on the same columns and needs no re-blessing. Option 2 (rewriting the
Expectation column to be about persistence) was deliberately not taken; the
note records that, and that the old expectations are recoverable from git
history if it ever is.
notes/plan-tf24-scenario-framework.md records the decision and corrects its own
stale 5/8 baseline section with the #570-head measurements (viability 8/8,
persistence 1/8, agreement 3/8).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Open
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #572. Implements options 3 + 1 — your stated preference: keep
statusas the numerical-viability gate, add persistence as the primary ecological metric, retire the bare match rate as the headline. No CSV rewrite, no re-blessing.The problem, restated from the measurements
classify_scm_run()calls a run a success onfinite && total > 0. Withbirth_rate = 1(whatbuild_scenario()sets)offspring_productionis R0, so that is far weaker than it looks: five of the eight hydraulic scenarios return R0 between 2e-15 and 6e-14 — numerically extinct — and every one was recorded as"persisted". All eight "succeeded", none of the five expected failures failed, and only one replaced itself.What changed
scenario_summary()now reports two labelled axes, plus agreement demoted:n_ran,n_crashed,viability_raten_persists,persistence_ratepersists_at(), #570)n_match,match_rate, expected-fail/success breakdownReflected in
scripts/run_scenario_gateway.Randinst/reports/scenario_scorecard.Rmd. On the #570-head numbers the gateway now prints:Viability is counted from the recorded
crashedflag rather than frommatch, so an expected failure that crashes counts against viability while still counting for agreement — the two axes have to be able to disagree or there is nothing to separate.Why agreement is demoted rather than dropped
With the crashes fixed (#546/#552/#554) the match rate mostly measures how well the CSV's crash predictions have aged. The tell is that fixing the model lowered it, 5/8 → 3/8. It is still worth reporting; it is not a quality score.
Not done, deliberately
Option 2 (rewriting the
Expectationcolumn to be about persistence). That discards the crash-prediction record and forces a re-blessing.notes/plan-tf24-scenario-framework.mdrecords the decision, that option 2 was declined, and that the old expectations are recoverable from git history if it is ever taken.statusandoutcomeare untouched, so the blessed-baseline diff is still defined on the same columns and the baseline is not re-blessed. Scorecards predating thepersists/crashedcolumns (including the blessed baseline) still summarise rather than error.Threshold caveat, recorded
R0 ≥ 1 is evaluated at a fixed birth rate, so it carries the same density-dependence artefact that inflated TF24t-vs-TF24 R0 gaps in unrelated work. All scenarios use
birth_rate = 1, so the comparison is internally consistent;persists_at(total, finite, threshold = 1)takes the threshold as an argument for when that stops being true.Done-when
run_scenario_gateway.Rand the report is no longer a bare match ratenotes/plan-tf24-scenario-framework.mdupdated with the option takenTests
test-scenario-eval.R: 50 expectations, green. Two new blocks — the axes are reported separately and can disagree; viability is counted fromcrashed, not from the match.🤖 Generated with Claude Code