Skip to content

Bugfix/tau decay detection - #72

Merged
jlazar17 merged 3 commits into
masterfrom
bugfix/tau-decay-detection
Jul 28, 2026
Merged

jlazar17 merged 3 commits into
masterfrom
bugfix/tau-decay-detection

Conversation

@kcarloni

Copy link
Copy Markdown
Contributor

Fixes a bug in TauRunner.jl: propagate_charged_lepton! -- previously, the code checked if PROPOSAL had decayed the lepton by checking whether its energy = its mass. This will not work for particles that decay in flight.

The fix instead checks for decays by querying PROPOSAL's has_decay flag, matching the Python reference's sec.decay_products() check.

kcarloni and others added 3 commits May 19, 2026 21:54
PROPOSAL stores its interpolation-table directory in a process-global
(InterpolationSettings::TABLES_PATH), mutated only by set_tables_path.
It does NOT read a `tables_path` key from the JSON config.

The three config generators embedded `tables_path` into config["global"],
so the entire PROPOSAL_TABLES_PATH env var -> get_proposal_tables_path()
-> JSON chain terminated in a key PROPOSAL silently discarded. Tables
always landed at PROPOSAL's compiled-in default (/tmp), regardless of
PROPOSAL_TABLES_PATH.

Fix: push the resolved path into PROPOSAL via set_tables_path in
create_temp_config (the single chokepoint run immediately before every
create_propagator_* call) and drop the dead JSON keys.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The slab and spherical charged-lepton propagators inferred that a lepton
had decayed from its final energy dropping to the rest mass. Taus decay in
flight while still carrying most of their energy, so this test almost never
fired for a genuine tau decay: PROPOSAL would decay the tau, but the loop
left it as a surviving charged lepton at the decay vertex. Query PROPOSAL's
has_decay flag on the returned secondaries instead, matching the Python
reference's sec.decay_products() check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
create_temp_config mutated PROPOSAL's process-global table directory as a
side effect of writing a JSON file, and called set_tables_path
unconditionally. The PROPOSAL.jl build this package dev-links does not
define that binding, so every propagator construction failed with
UndefVarError.

Move the mutation into ensure_proposal_tables_path!, called from the two
functions that actually build propagators. It is idempotent, honors
PROPOSAL_TABLES_PATH set after module load, and no-ops on PROPOSAL builds
without the settings bindings.

Add a regression test for the decay-in-flight fix: a 1e16 eV tau in a 10 km
standard-rock slab has a boosted decay length of ~0.5 km, so it decays in
flight at millions of times its rest mass. The previous rest-mass check
recorded zero decays over five trials; the has_decay check records five.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jlazar17
jlazar17 merged commit d139e73 into master Jul 28, 2026
0 of 2 checks passed
@jlazar17
jlazar17 deleted the bugfix/tau-decay-detection branch July 28, 2026 11:10
thomwg11 added a commit to TAMBO-Observatory/TamboSim that referenced this pull request Sep 4, 2026
…y fix

icecube/TauRunner#72 (361661f, 2026-07-22) detects charged-lepton decay via
PROPOSAL's has_decay flag instead of testing whether the energy fell to the
rest mass. Taus decay in flight while still carrying nearly all their energy,
so the old test almost never fired and TauRunner returned a surviving tau at
the decay vertex.

With the fix TauRunner hands back a nu_tau, so inject_neutrino_event no longer
returns early at src/injection/inject.jl:265 and instead samples a vertex via
force_interaction_vertex. That moves where PROPOSAL starts relative to the
terrain and raises the post-propagation in-air fraction:

  gamma=1.0  0.200 -> 0.240  (95/395)
  gamma=2.0  0.197 -> 0.205  (79/386)

Both measured on CI run 33823627332. The gamma=2.0 value was still inside the
0.02 tolerance but had drifted for the same reason, so both are re-baselined.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
thomwg11 added a commit to TAMBO-Observatory/TamboSim that referenced this pull request Sep 4, 2026
…cay fix (#103)

* test: log measured post-propagation in-air fraction

Print the measured fraction (and its numerator/denominator) for each
spectral index before asserting, so a drift in this regression number is
readable straight off a CI log instead of needing a probe branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: re-baseline post-propagation in-air fraction for TauRunner decay fix

icecube/TauRunner#72 (361661f, 2026-07-22) detects charged-lepton decay via
PROPOSAL's has_decay flag instead of testing whether the energy fell to the
rest mass. Taus decay in flight while still carrying nearly all their energy,
so the old test almost never fired and TauRunner returned a surviving tau at
the decay vertex.

With the fix TauRunner hands back a nu_tau, so inject_neutrino_event no longer
returns early at src/injection/inject.jl:265 and instead samples a vertex via
force_interaction_vertex. That moves where PROPOSAL starts relative to the
terrain and raises the post-propagation in-air fraction:

  gamma=1.0  0.200 -> 0.240  (95/395)
  gamma=2.0  0.197 -> 0.205  (79/386)

Both measured on CI run 33823627332. The gamma=2.0 value was still inside the
0.02 tolerance but had drifted for the same reason, so both are re-baselined.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Revise comments and baseline date in regression test

Updated baseline date and comments for tau decay detection.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: kcarloni <kcarloni@g.harvard.edu>
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.

2 participants