Skip to content

Add reproducibility floor + TrackRAD ingestion & integrity harness (Charter Phase 0/1) - #7

Open
vidyuthdev wants to merge 4 commits into
passlab:masterfrom
vidyuthdev:feat/charter-trackrad-phase01
Open

Add reproducibility floor + TrackRAD ingestion & integrity harness (Charter Phase 0/1)#7
vidyuthdev wants to merge 4 commits into
passlab:masterfrom
vidyuthdev:feat/charter-trackrad-phase01

Conversation

@vidyuthdev

Copy link
Copy Markdown
Contributor

Summary

Establishes the Charter-driven reproducibility and data-integrity foundation, plus a real-data ingestion path for the TrackRAD2025 asset. Four self-contained commits:

  1. Reproducibility floor (Phase 0) — deterministic run logging with pinned RNGs, git SHA, package versions, and a stable reproducibility checksum written per run.
  2. TrackRAD2025 loader — typed TrackRADCase reading real fields only (cine frames, tumour mask, JSON sidecars), deterministic case_checksum, patient-level enumeration, and a placeholder quarantine (to_smoke_test_bundles refuses without acknowledge_synthetic=True, stamps PLACEHOLDER_TRACKRAD_*).
  3. Data-integrity harness (Phase 1, ingestion) — per-case checks (frames finite/3D, in-plane isotropic + ~1mm, sidecars present, mask geometry matches frames) with patient-level uniqueness asserted in code, and a reproducible per-center scorecard logged with a stable sweep_checksum.
  4. Charter + tracking docsCLAUDE.md (charter), PROGRESS.md, BACKLOG.md; ignore regenerated runs/.

Scope & integrity notes

  • TrackRAD is an ingestion smoke-test asset only, never a dose benchmark (Charter §3): it has no dose, no beams, no CT/HU. These checks say nothing about dose accuracy.
  • Reading real bytes surfaced two card-vs-reality discrepancies, both fixed: the sidecar is b-field-strength.json (suffix-matched), and .mha stores time as the last numpy axis (canonicalised to (T,H,W)).
  • The integrity gate earned its keep by catching real header rounding on B_002 — fixed the check, not the data.

Verification

  • tests/test_repro.py 5/5
  • tests/test_trackrad_loader.py 10/10 (incl. on real data)
  • tests/test_trackrad_integrity.py 5/5 (incl. catches injected NaN + mask/frame mismatch)
  • Real multi-center sweep: 12/12 patients integrity-clean across 3 centres / 2 field strengths.

Independent of #6 (rebased onto master); no overlap with the CI-fix PR.

Deterministic run logging with pinned RNGs, git SHA, package versions,
and a stable reproducibility checksum written per run. tests/test_repro.py
proves determinism across calls and seed-sensitivity (5/5).
Typed TrackRADCase loader reading real fields only (cine frames, tumour
mask, JSON sidecars), deterministic case_checksum, patient-level
enumeration. Placeholder quarantine: to_smoke_test_bundles refuses without
acknowledge_synthetic=True and stamps PLACEHOLDER_TRACKRAD_*. Canonicalises
.mha to (T,H,W) and suffix-matches the b-field-strength sidecar — two
card-vs-reality discrepancies found by reading real bytes. Charter §3:
TrackRAD is an ingestion smoke-test only, never a dose benchmark.
tests/test_trackrad_loader.py 10/10, including on real data.
Per-case ingestion checks (loads, frames finite/3D, in-plane isotropic +
~1mm, sidecars present, mask geometry matches frames) with patient-level
uniqueness asserted in code, not comment (Charter §2.4). Reproducible
per-center scorecard logged to runs/ with a stable sweep_checksum. Verified
12/12 patients clean across 3 centres / 2 field strengths; the gate earned
its keep by catching real header rounding on B_002 (fixed the check, not
the data). tests/test_trackrad_integrity.py 5/5 (incl. catches injected
NaN + mask/frame mismatch).
Charter (CLAUDE.md) defining integrity rules and phase gates, PROGRESS.md
tracking phase status against demonstrated evidence, BACKLOG.md for
deferred items (MRI-as-geometry-input, tracking service). Ignore runs/
(regenerated provenance logs).
@vidyuthdev
vidyuthdev force-pushed the feat/charter-trackrad-phase01 branch from d0c022e to 6b5d20c Compare August 9, 2026 19:05
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