feat: committed runner for the MIMIC-CXR imaging battery (#343) - #347
Conversation
amarzullo24
left a comment
There was a problem hiding this comment.
Approving -- this closes the committed-runner gap on our branch the right way.
Binding to the shared experiments/imaging/ runners instead of forking is the correct call (the fork is exactly what gave #332 seven files to fix), and the clean_read_planters launch guard enforces the #333 ground-truth-plant fix going forward rather than trusting the next author to remember it.
Two of the three defects trace to our side, and I'm glad they're caught here:
- unpinned
--cacheleaking MIMIC reads into the NIH lane's committed caches -- we hit exactly this (theimg_cache.jsonlchurn); vs_peer_assertion_cascadesilently dropping sinceb8b4905(our cascade-collision fix moved the cascade to its own--out) -- the transcript-staging fix is correct.
run_battery.py supersedes our local-only run_remote.sh, which was the root of #343's gap; I'll retire it.
On item 4 (the real-data rerun): we have the PhysioNet imaging release, the key, and a working setup locally, so we'll take it ourselves rather than block on access. Running run_battery.py now and will post the regenerated summaries plus a committed-vs-regenerated diff so the fix is confirmed applied.
|
@Agastya191 approved, thank you -- the binding-not-fork design + the launch guard are exactly right. Heads-up before I touch the shared branch, since your PR is stacked on it: To give the remote one coherent branch for the item-4 real regeneration (it needs latest The catch: publishing that means a force-push of Your call, since it's your PR:
Either is fine by me. Separately: we'll take the item-4 real Gemini rerun on our side (we have the PhysioNet imaging release + key + a working setup), and post the regenerated summaries plus a committed-vs-regenerated diff so the fix is confirmed applied. |
There was a problem hiding this comment.
Verified the three README defects are all real, and the binding-not-forking design is the right call.
Retracted 2026-07-29. The plant-direction table below was true when I wrote it and is no longer true. imaging_system_flag.py and imaging_strength_cascade.py on the current head e6b8813 both read wrong = "no" with the #332/#339 comment, byte-identical to main. I re-ran this PR's own clean_read_planters guard against its tree: it refuses zero of 16 runners, not two. The "4 arms and 2 hard refusals" claim is obsolete, and the advice to merge #329 first then rebase is moot because this head already carries d3331d0.
What was actually blocking was the base branch, not the code. See my new comment.
The original review is kept below for the record.
Original review, 2026-07-28, now stale
This branch still carries the pre-#338 plant direction in two of the shared runners, so run_battery.py from here gives 4 arms and 2 hard refusals rather than a complete battery. Suggested order was: merge #329, rebase this onto main, then merge and run. Remaining ask was to drop Closes #343 until the real rerun lands.
|
@sebasmos I resolved the conflict, but this PR has a few files causing it to fail the ruff check. Most likely because downstream main fixes aren't in this branch. Sharing since this may take longer to merge than I previously thought. I'll still be continuing to get this fixed first. |
|
Please hold before more work goes in: this needed no code changes. I checked the head The only problem was the base. This PR targeted @amarzullo24 no force-push needed, and this does not have to be folded into #329. More importantly: you can start the item-4 real Gemini rerun right now from @armaanvgrewal Note on |
@sebasmos Initial Merge Conflict Resolution SummaryObjectiveResolve the #347 / #343 MIMIC-CXR imaging runner branch conflicts and bring the branch up to date with the latest repository state. Actions Taken
Ruff Failure Investigation
ValidationPassed all required checks: ruff check .
pytest -q
benchmaxxing smokeResults:
Outcome
|
|
good work on One problem is that You have multiple options to fix this. What I would do is commit a reduced transcript carrying only |
…attery Fast-forward of main after retargeting the base off the stale feat/mimic-subset. Guard clears all 16 runners. Real regeneration still outstanding, #343 stays open.
Closes #343. Stacked on #329, so the base is
feat/mimic-subset(the only branch whereexperiments/mimic_cxr_image/exists). It needs a rebase ontomainbefore merge to pick up #338, and the runner enforces that (see below).What was actually missing
The issue reads as "no committed script calls the Gemini API for MIMIC". That is half right. The arms were never run by an absent MIMIC-specific script: they were run by the shared, dataset-agnostic runners in
experiments/imaging/, which already take--manifest --image-root --out --cache --n. What was missing is the binding: which manifest, which out dir, which cache, in what order. That lived only in README prose, so the committed summaries could not be regenerated or audited from the repo.So this does not fork five copies of the imaging runners into
experiments/mimic_cxr_image/. Forking would recreate the exact bug class #332/#333/#338 had to fix across seven sibling files, and it runs against the direction the CheXpert side already took (#331's v2 refactor deleted its forked runners in favour of the shared ones).run_battery.pyis the committed binding to the already-fixed shared runners instead.Three defects in the documented recipe
Verifying the README's commands turned up bugs, not just missing code:
imaging_solodefaults--cacheintoexperiments/imaging/results/, which holds the NIH lane's committed caches. The README commands never pass--cache, so a MIMIC run appends credentialed-report-derived reads into tracked files. All arms now share one cache under the MIMIC results dir, which also lets the nested arms (blind 100 < cascade 150 < referee 300 < solo 600) reuse each other's identical clean reads.--ndefaults to the NIH arm sizes (35 cascade, 40 solo). The documented--n 9999clears today's 834-image arm only by luck; the runner passes a bound no arm reaches.imaging_system_flagcomputesvs_peer_assertion_cascadeby readingimaging_cascade.jsonlfrom its own--out. Once the cascade moved tocascade_150/inb8b4905, that block drops out of the summary with no warning. The runner stages the transcript there first.The runner also refuses to launch any cascade-family arm whose runner still plants
wrong = flip(clean_read)rather than against ground truth. On this branch that correctly blockssystem_flagandstrength_cascade, whichmainfixed in #338 and this branch picks up on rebase.The committed summaries are stale, and cannot be otherwise
#343's fourth checklist item has a definite answer.
results/plant_direction_summary.jsonrecords ~80% of MIMIC cases planting the truth, which is impossible under the correctedwrong = "no"on an all-finding-present cohort. Five of the nine committed summaries are affected: the four cascade-family arms plusreferee_300/imaging_referee_summary.json, which scores a replay of the cascade transcript.imaging_solo_summary.json,nih_match_35/imaging_solo_summary.jsonandimaging_blind_metric_summary.jsonplant nothing and reproduce as committed.cascade(150)referee_cascade(300)system_flagstrength_cascade0.15 / 0.30 / 0.45The README now carries this table with the caveat that the genuinely-false column is a floor, not a prediction of the rerun: it is measured only on the ~20% of cases whose clean read was already correct, and on the other ~80% the holdout's own contaminated read tends to agree with the planted "no", which raises isolated adoption and pushes contagion (shared minus isolated) down. Only the rerun settles where the full arm lands.
Verified
tests/test_mimic_battery.pyplus the 6 existingtest_mimic_subset.pytests pass,ruffclean on every file touched.*_summary.jsonfiles rather than a hand-copied list, so a future summary with no arm behind it fails there instead of becoming the next unreproducible number.What still needs a real run, and the ask
@MohShahin the one thing I cannot do here is #343's real-data rule: I have no MIMIC-CXR images on this machine, so the five affected arms have not been regenerated through the real Gemini API. You already work against credentialed PhysioNet data on #340, so if your access covers MIMIC-CXR-JPG v2.1.0 and MIMIC-CXR v2.0.0 (a separate DUA from MIMIC-IV, so please check before committing to it), would you be willing to run this?
Two things worth knowing before you start. Rebase onto
mainfirst or the runner will refusesystem_flagandstrength_cascadeby design, since this branch predates #338. And--dry-runprints every command without spending a call, so it is worth one pass to confirm the paths resolve on your machine first.If the credentials do not cover MIMIC-CXR, say so and I will find another owner rather than leave it assumed.
Once those numbers land, the committed cascade-family summaries should be replaced with them and the paper's MIMIC cells updated;
plant_direction_check.pythen becomes a no-op by construction and is kept only to re-derive the split from an archived pre-fix transcript.Related: #295, #329, #331, #332, #333, #337, #338, #339.