log_evidence_internal's forward flag is only a filtering quantity before convergence #28

Closed
opened 2026-08-27 14:48:53 +00:00 by logaritmisk · 1 comment
Owner

log_evidence_internal(forward: bool, ..) (src/history.rs) uses skill.forward as the per-event prior. That is a genuine forward-only (filtering) quantity ONLY on a history that has never been converged: History::iteration alternates backward and forward sweeps, so from the second iteration onward the likelihood feeding the forward message has already absorbed backward information. The in-crate test that asserts batch and forward evidence are equal passes only because its fixture is never converged. Either document the constraint or fold the flag into the new filtered_pass and delete it. Discovered while implementing #19.

`log_evidence_internal(forward: bool, ..)` (`src/history.rs`) uses `skill.forward` as the per-event prior. That is a genuine forward-only (filtering) quantity ONLY on a history that has never been converged: `History::iteration` alternates backward and forward sweeps, so from the second iteration onward the likelihood feeding the forward message has already absorbed backward information. The in-crate test that asserts batch and forward evidence are equal passes only because its fixture is never converged. Either document the constraint or fold the flag into the new `filtered_pass` and delete it. Discovered while implementing #19.
Author
Owner

Taken the "document the constraint" branch in eeb43e3 rather than deleting the flag.

log_evidence_internal now carries:

forward selects skill.forward as each event's prior instead of the cavity. That is a genuine forward-only (filtering) quantity ONLY on a history that has never been converged: iteration alternates backward and forward sweeps, so from the second iteration onward the likelihood feeding the forward message has already absorbed backward information. For a filtering quantity that holds after convergence, use filtered_log_evidence.

Documented rather than deleted because the flag is pub(crate) and still has one honest use — the in-crate test that asserts batch and forward evidence agree on an unconverged fixture, which is a real property of an unconverged history and worth keeping pinned. Folding it into filtered_pass would delete that check along with the flag.

Reasonable to reopen if you would rather see it gone; the doc is the cheap correct move, not necessarily the final one.

Taken the "document the constraint" branch in `eeb43e3` rather than deleting the flag. `log_evidence_internal` now carries: > `forward` selects `skill.forward` as each event's prior instead of the cavity. That is a genuine forward-only (filtering) quantity ONLY on a history that has never been converged: `iteration` alternates backward and forward sweeps, so from the second iteration onward the likelihood feeding the forward message has already absorbed backward information. For a filtering quantity that holds after convergence, use `filtered_log_evidence`. Documented rather than deleted because the flag is `pub(crate)` and still has one honest use — the in-crate test that asserts batch and forward evidence agree on an unconverged fixture, which is a real property of an unconverged history and worth keeping pinned. Folding it into `filtered_pass` would delete that check along with the flag. Reasonable to reopen if you would rather see it gone; the doc is the cheap correct move, not necessarily the final one.
logaritmisk added the docsnumerics labels 2026-09-07 13:53:31 +00:00
Sign in to join this conversation.