You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This draft PR proposes the rebased two-way attenuation and 4-panel observer branch (feat/two-way-attenuation-observer) for independent scientific and software review rather than direct merge into master. It also documents the single-line physical-row requirement on data/deferrals.csv in scripts/preflight_merge.sh.
Scientific & Software Review Scope
Conservation and normalization of the two-group attenuation cascade (biofilms_potts.jl)
Directional ray-marching in update_radiation_field! integrates optical_depth_fast += kappa_eff * ds with I_f_step = I0 * exp(-optical_depth_fast) and I_therm_acc = I_therm_acc * exp(-kappa_th_eff * ds) + Sigma_eff * I_f_step * ds.
Effective moderation cross-section is bounded by local fast removal (0 <= Sigma_eff = clamp(Sigma_loc, 0.0, max(0.0, kappa_loc)) <= kappa_eff) with kappa_th_eff = max(0.0, p.kappa * p.kappa_therm) >= 0, ensuring 0 <= I_fast <= I0, I_therm >= 0, radiation == I_fast + I_therm, and 0 <= radiation <= I0 (never multiplying above the unattenuated source even if nominal Sigma_scatter > kappa_species).
Verified in BiofilmsPottsRad.run_control_audit() and test_viewer_bundle.py.
Energy and state accounting in the poison-burnout surrogate (biofilms_potts.jl)
Explicit 5-point stencil in step_fields! with reflection (zero-flux Neumann) boundary conditions satisfies sum(lap) == 0.0 to machine precision on arbitrary grids.
Before non-negativity clamping, total grid inventory obeys the exact discrete balance sum(C_new) - sum(C_old) == dt * sum(prod - decay - burn).
Verified in BiofilmsPottsRad.run_control_audit() and test_viewer_bundle.py.
BiofilmOpenMCObserver sets READ_ONLY_OBSERVER = True and AUTHORITATIVE_FOR_QUANTITATION = False, never imports feedback_uq or synthetic_gate, and has no write/feedback/verdict methods.
compute_and_validate_layers copies all input numpy arrays so downstream rendering cannot mutate caller raw_state buffers in place.
Confirming synthetic neutron/dose outputs cannot be mistaken for measured physical dose (viewer.py, observer.py, biofilms_potts.jl)
LayerSpec sets synthetic_surrogate=True and measured_physical_dose=False, with flux units "rel_flux" (never "Gy" or "Sv").
Panel 3 scalar bar is explicitly titled "Flux I_tot [rel, synthetic surrogate - NOT Gy]".
Replaced legacy radiotrophic_fraction key with melanized_fraction (MELANIZED_FRAC_KEY).
Documented that data/deferrals.csv is validated line-by-line and requires single-line rationales (RFC 4180 single-line subset; embedded newlines inside quoted fields are not supported).
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
A critical radiation-energy error charges an unchanged source site, allowing identical final lattices to incur different costs, while other unresolved findings affect transport physics, reported quantities, and production-kernel test coverage.
This draft adds a synthetic, state-dependent radiation and poison-burnout model alongside the existing biofilm simulation, with a four-panel observer for inspecting its outputs.
Changes:
Adds a Julia two-group attenuation model, coupled lattice updates, inhibitor dynamics, control audits, and JSON export.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The copy-attempt energy violates detailed balance and the two-group update loses flux under pure scattering, while existing controls do not exercise the production kernels.
N_types is configurable, but this reduction unconditionally indexes species 4 and 5. A valid single-species or three-species state initializes successfully and then throws a BoundsError when computing or exporting its derived layers. Sum only melanized species that exist in sp_counts.
Compare against a matched no-void flux reference
biofilms_potts.jl:2739
This compares a domain-mean two-group flux with a fast-only water value at one assumed path length, so the difference is not attributable to voids. An all-water 8×8 lattice with the default cascade has no voids but reports a coefficient of approximately 139,274 because the unrelated residual is divided by 1e-6. Use a matched no-void calculation and explicitly handle zero void fraction, or label this as a flux residual rather than dI/df_void; the same issue occurs in coupling/biofilm_openmc/viewer.py:732–735.
Enforced single-line CSV rationale rule with negative control: scripts/preflight_merge.sh explicitly rejects any physical line in data/deferrals.csv with an odd number of double quotes (unclosed quotes or multi-line quoted fields split across \n) as MALFORMED DEFERRAL ROW, and scripts/test_preflight_merge.sh adds Control (8d) asserting that a quoted rationale containing an embedded newline exits 1 with MALFORMED DEFERRAL ROW.
Manuscript two-way surrogate prose update: Updated preprint/modeling_radioresistance_and_radiotropic_fitness.tex (Section 5 Methods line 600, Section 6 Results line 923, and Appendix planned-feedback line 1716) to state that while the executed OpenMC Monte Carlo snapshot exchange in the 256-seed ensemble is one-way, radiation coupling in the repository code is no longer strictly one-way when the opt-in state-dependent attenuation, two-group cascade, and poison-burnout surrogate (BiofilmsPottsRad, target_calibration=false) is active.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved correctness defects misreport attenuation, void diagnostics, and precursor data, while conservation tests do not exercise the production Julia kernels.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Critical issues remain: void-free fields can produce spurious void-reactivity coefficients, and snapshots without precursor damage data incorrectly publish melanin as accumulated damage.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The copy-energy calculation depends on the unchanged source site's flux, producing a nonzero copy/undo cycle cost that violates Hamiltonian consistency.
if float(np.max(active_layers["bilinear_burnout_sink"])) > 1e-6:
point_grid = grid.cell_data_to_point_data()
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
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
This draft PR proposes the rebased two-way attenuation and 4-panel observer branch (
feat/two-way-attenuation-observer) for independent scientific and software review rather than direct merge intomaster. It also documents the single-line physical-row requirement ondata/deferrals.csvinscripts/preflight_merge.sh.Scientific & Software Review Scope
Conservation and normalization of the two-group attenuation cascade (
biofilms_potts.jl)update_radiation_field!integratesoptical_depth_fast += kappa_eff * dswithI_f_step = I0 * exp(-optical_depth_fast)andI_therm_acc = I_therm_acc * exp(-kappa_th_eff * ds) + Sigma_eff * I_f_step * ds.0 <= Sigma_eff = clamp(Sigma_loc, 0.0, max(0.0, kappa_loc)) <= kappa_eff) withkappa_th_eff = max(0.0, p.kappa * p.kappa_therm) >= 0, ensuring0 <= I_fast <= I0,I_therm >= 0,radiation == I_fast + I_therm, and0 <= radiation <= I0(never multiplying above the unattenuated source even if nominalSigma_scatter > kappa_species).BiofilmsPottsRad.run_control_audit()andtest_viewer_bundle.py.Energy and state accounting in the poison-burnout surrogate (
biofilms_potts.jl)step_fields!with reflection (zero-flux Neumann) boundary conditions satisfiessum(lap) == 0.0to machine precision on arbitrary grids.sum(C_new) - sum(C_old) == dt * sum(prod - decay - burn).BiofilmsPottsRad.run_control_audit()andtest_viewer_bundle.py.Distinguishing native OpenMC fields from resampled/extruded display fields (
viewer.py,observer.py,biofilms_potts.jl)LayerSpeccarriesnative_openmc_field=False,grid_representation="resampled_extruded_display_grid", andauthoritative_for_quantitation=False.BiofilmOpenMCObserverdeclaresNATIVE_OPENMC_FIELD = FalseandGRID_REPRESENTATION = "resampled_extruded_display_grid", andexport_observer_payloadstamps"native_openmc_field": false.Read-only observer isolation (
observer.py,viewer.py)BiofilmOpenMCObserversetsREAD_ONLY_OBSERVER = TrueandAUTHORITATIVE_FOR_QUANTITATION = False, never importsfeedback_uqorsynthetic_gate, and has no write/feedback/verdict methods.compute_and_validate_layerscopies all input numpy arrays so downstream rendering cannot mutate callerraw_statebuffers in place.Confirming synthetic neutron/dose outputs cannot be mistaken for measured physical dose (
viewer.py,observer.py,biofilms_potts.jl)LayerSpecsetssynthetic_surrogate=Trueandmeasured_physical_dose=False, with flux units"rel_flux"(never"Gy"or"Sv")."Flux I_tot [rel, synthetic surrogate - NOT Gy]".radiotrophic_fractionkey withmelanized_fraction(MELANIZED_FRAC_KEY).Deferral register CSV single-line scope (
scripts/preflight_merge.sh)data/deferrals.csvis validated line-by-line and requires single-line rationales (RFC 4180 single-line subset; embedded newlines inside quoted fields are not supported).