Adopt Form K_reg photon fit; remove polyethylene xfails#22
Merged
Conversation
Pulls in the K_reg photon-fit form from rad_point_kernel_core 4.2.0: worst holdout z (21 materials): 54.3 -> 36.6 mean holdout z: 14.7 -> 6.0 median holdout z: 7.1 -> 2.4 The 3 previously-xfailed assertions in test_polyethylene_buildup_fit.py (Property 1 for dose-AP-coupled-photon and dose-AP-total) now pass on the original 6-anchor polyethylene fixture: K_reg captures the late- stage exponential growth that Power x saturator could not. xfail markers removed. The test_extrapolation_is_bounded upper bound is loosened from 30 to 1000. The previous bound was calibrated against the broken Power x saturator's conservative extrapolation; with K_reg correctly tracking late growth, B_total can legitimately reach 3 digits at 4 m of poly (an independent MC scan at 350 cm gives B_p ~= 82). The new bound still catches genuine numerical blow-up. Adds the cross-material regression harness used to design and tune K_reg as a V&V artifact: verification_and_validation/photon_fit_test_suite.py verification_and_validation/photon_fit_cache.json docs/vnv/photon_fit_quality.md The harness loads 21-material MC anchors, fits all candidate forms, and reports per-material training and holdout z-scores. Re-runnable to gate any future fit-form change. Bumps rad_point_kernel_core dep to >=4.2.0.
shimwell
added a commit
that referenced
this pull request
May 1, 2026
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.
Summary
Pulls in rad_point_kernel_core PR #16 (Form K_reg photon fit). Bumps the core dep
>=4.1.0->>=4.2.0.The previously-xfailed assertions in
tests/test_polyethylene_buildup_fit.py(Property 1 fordose-AP-coupled-photonanddose-AP-total) now pass cleanly — K_reg captures the late-stage exponential growth that Power × saturator could not. xfail markers removed.Changes
pyproject.toml>=4.1.0→>=4.2.0tests/test_polyethylene_buildup_fit.pyverification_and_validation/photon_fit_test_suite.pyverification_and_validation/photon_fit_cache.jsondocs/vnv/photon_fit_quality.mddocs/vnv/index.md.gitignore/outputs/(transient)Extrapolation bound update
test_extrapolation_is_boundedpreviously asserted0.1 < B_total < 30at t=300/350/400 cm of polyethylene. With the broken Power × saturator, predicted B_total at 400 cm was ~0.9 (saturated). With K_reg correctly tracking the late-stage growth in the data, B_total at 400 cm reaches ~56 — physically right, since an independent MC run at 350 cm givesB_p ≈ 82. The new bound0 < B < 1000still catches numerical blow-up but accommodates the real growth.V&V harness
photon_fit_test_suite.pyis the regression-testing tool used to design K_reg. It loads 21 materials' worth of MC anchors, fits every candidate form inCANDIDATES, and reports per-material training + holdout z-scores. Future fit-form changes can be gated through it.The 21 materials span:
Test plan
Will be red until core 4.2.0 lands on PyPI; standard sequence.