DRAFT: LISA ILE driver — portfolio policy + AV state/collapse safety (passes 4–5a, stacked on #99) - #100
Closed
oshaughnessy-junior wants to merge 5 commits into
Closed
Conversation
…low persistence Pass 4 of the catch-up (pass 3, MC-error replicas, deferred). Closes 14 of the 108 remaining gap items (gap 108 -> 94). Pure pass-through to samplers this driver ALREADY wires: it exposes the same ok_lnL_methods as the main driver and builds mcsamplerPortfolio the same way, and its portfolio setup block was byte-identical to main's apart from the missing kwargs. Before this the knobs were reachable only through --sampler-portfolio-args, an eval-able dict; the pipeline passes the named flags. Option definitions are copied verbatim, and a test asserts default/type/action/choices match the main driver's for all 14. A knob that means something different in the two drivers is worse than a missing one: the same pipeline command line would otherwise produce two different integrations. The freeze-policy assembly is inline in both drivers rather than a function, so the tests extract the block and exec it against a fake opts -- testing the real source rather than a paraphrase. That covers the property the assembly exists for: an option left UNSET must stay out of the dict so the sampler keeps its own default, and 0 (which disables probing/reviving) is a REAL value that truthiness would silently drop. NF flow load/save go through _maybe_load_nf_flow / _maybe_save_nf_flow for the same reason the L0 rescue did: this driver has TWO analyze_event variants, and wiring only one would be a silent half-port. A test asserts both get both hooks and that they straddle the integration in the right order. TESTS. test_lisa_sampler_plumbing.py (55), wired into lisa-check. Revert-checked with 7 mutations: a drifted default, a dropped `is not None` guard, inverted VARAHA precedence, a dict that never reaches setup(), a lost hasattr guard, a misplaced save hook, and an unguarded NF exception. The hasattr mutation came back WEAK and the test was rewritten. Asserting "does not raise" was worthless there: the body is wrapped in `except Exception`, so dropping the guard still does not raise -- it announces "loading pre-trained flow", calls a method that does not exist, and swallows the AttributeError, so every non-NF run would log a flow load that never happened. The test now asserts the hook stays SILENT for a sampler with no flow support. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
August 16, 2026 01:01 — with
GitHub Actions
Active
…collapse gate Pass 5a of the catch-up. Closes 5 of the 94 remaining gap items (gap 94 -> 89): --sampler-save-state, --sampler-load-state, --sampler-anisotropic-bins, --reject-collapsed-live-volume, and _reject_if_collapsed. All four are sampler-agnostic. The saved state is the AV sampler's own live-volume grid, which carries no detector convention; the bin allocation is per-axis on that same grid. THE ONE THING TO CARRY FORWARD. The main driver calls its collapse gate TWICE -- on the first run AND on the replica pool, because replication can turn a healthy first run into a collapsed POOL, and gating only the first would silently bypass the flag for exactly the case pooling introduces. This driver has no replica pooling yet, so only the first call exists here. That is recorded in the helper's docstring, in the drift ledger, and in a test that asserts the warning is still written where whoever ports --mc-error-replicas will be working. The helpers are hoisted to module level rather than nested (as _reject_if_collapsed is in main), because this driver has TWO analyze_event variants and nesting would mean two copies. A test pins the hoisted body AST-identical to main's nested one. THIS EXPOSED A FALSE POSITIVE IN THE DRIFT AUDIT, now fixed. It compared FUNC items by QUALIFIED name, so main's analyze_event._reject_if_collapsed did not match this driver's correctly-hoisted top-level _reject_if_collapsed, and the item would have sat in the gap forever no matter how well it was ported. A gate that cannot be satisfied is a gate people learn to ignore. FUNC items are now matched on the bare name as well. TESTS. test_lisa_av_state.py (27), wired into lisa-check. Revert-checked with 8 mutations: the lost AV-method restriction on save, bins not reaching portfolio members, bins ceasing to be opt-in, a gate that ignores its flag, a gate that fires on healthy runs, a collapse that is no longer announced, the gate moved before the not(res) guard, and deletion of the second-call-site warning. Each caught by its named test; file restored byte-identical. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
August 16, 2026 01:17 — with
GitHub Actions
Active
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
August 16, 2026 10:53 — with
GitHub Actions
Active
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
August 16, 2026 10:53 — with
GitHub Actions
Active
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
August 16, 2026 11:00 — with
GitHub Actions
Active
Owner
Author
|
Superseded by #106, which consolidates this stack onto current |
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
August 16, 2026 11:18 — with
GitHub Actions
Active
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.
Draft. Consolidated passes 4–5a, stacked on #99 (which is stacked on #98). The head branch was safely fast-forwarded from #100 through #101; no history was rewritten.
Closes 17 of the 108 remaining drift items (gap 108 → 91):
--sampler-save-state,--sampler-load-state,--sampler-anisotropic-bins,--reject-collapsed-live-volume, and_reject_if_collapsed.Portfolio policy
The named CLI options now reach
mcsamplerPortfolio.setup(). Unset values stay out of the override dict so sampler defaults remain authoritative; zero remains a meaningful value; and--portfolio-varaha-can-freezewins over--portfolio-varaha-never-freeze.AV state and collapse safety
State load/save and anisotropic-bin allocation are wired into both LISA event variants. State is now saved only after the result guard and collapse gate accept the run. A rejected or failed L0 rescue marks its warm grid non-persistable, while the marker resets at the start of every later event so one rejection cannot suppress a healthy future save.
The collapse gate runs once per event variant. The main driver also gates a later replica pool; that second site remains explicitly deferred with
--mc-error-replicas, which this driver does not yet implement.Adversarial-review correction
The original #100 layer exposed
--nf-flow-load/save, but LISA's portfolio factory cannot construct an NF member and the portfolio aggregate has noload_flow/save_flowAPI. Those flags and dead hooks were removed. The drift ledger records them asPORTuntil NF member construction and member-directed persistence land together.Validation
git diff --checkis clean.The full local LISA script reached 188 passes; its six failures are environment-only subprocess failures from missing NumPy/igwn_ligolw in the selected host Python. #98's full GitHub Actions matrix, including
lisa-check, is green. This consolidated draft should receive a full matrix before it is marked ready.Still deferred
--internal-gmm-*options, which require an ecliptic-sky grouping decision.