Skip to content

perf(#178): propagate D18 Haar ensemble by deterministic block action - #181

Open
marcohost33-maker wants to merge 17 commits into
mainfrom
gpt56/issue178-d18-block-action-20260930
Open

marcohost33-maker wants to merge 17 commits into
mainfrom
gpt56/issue178-d18-block-action-20260930

Conversation

@marcohost33-maker

@marcohost33-maker marcohost33-maker commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Scope

Implements item 1 of #178 only: D18 initial_state_sensitivity. Resolvent/non-normality optimisation remains a separate measured follow-up.

Design

  • Adds propagate_block_at_time(L, B, t) alongside the trajectory primitive.
  • B is the Haar ensemble as RHS columns, so one expm_multiply block action replaces materialising expm(L*t) for larger systems.
  • D18 uses a separate conservative auto crossover from the 80-point trajectory path: dense n < 512 stays on the historical reference and applies the propagator column-by-column in the pre-diagnose() at d >= 8: the exponential action now propagates the trajectory — D18 and the resolvent/non-normality layers are the remaining bottlenecks #178 arithmetic order. Forced action remains available for differential tests.
  • Beyond that threshold, automatic selection still requires the equivalent one-vector matvec bound to beat one dense exponential plus the RHS applications. The separate threshold is intentional: D18 forms one dense expm, not one per grid point.
  • Critical determinism rule: SciPy condition (3.13) depends on n0, the RHS column count. The sub-step norm ceiling is therefore _SUBSTEP_NORM / n_rhs; using the trajectory's one-vector ceiling would re-enter randomised onenormest for D18 blocks and consume global np.random state.
  • D18 records the actual method as LepResult.initial_state_backend.

Regression pins

Non-goals

  • no classifier change; D18 remains advisory/report-only;
  • no D16/D17 definition change;
  • no resolvent/non-normality/transient methodology change;
  • no schema/manifest input change.

Refs #178. The implementation intentionally reuses the failure-domain and overflow-safe norm machinery merged in #176.

Exploratory crossover check

A local single-thread-style cross-check on the same damped-Ising family used by the trajectory benchmark found a non-monotone small/medium crossover for the one-expm D18 workload: at n=64 block action was faster in that environment, at n=256 dense was faster, and at n=1024 block action was again clearly faster. These are not release performance claims; they are the reason auto does not reuse issue #162's n=64 trajectory threshold and instead stays conservative below n=512. A target-hardware benchmark remains follow-up evidence.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

This branch has not been deployed

No deployments
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.

1 participant