Component audit snapshot + 6 ideation follow-ups (replay tooling, golden vectors, linoss delegation, population cap)#11
Open
bionicbutterfly13 wants to merge 14 commits into
Open
Conversation
…omponent tests - Recursive genotype freezing (FrozenDict) on Strategy - Simplify the in-memory provider - Expand unit/contract/integration coverage across components - Remove the placeholder contract test
The README claimed cross-platform drift 'surfaces as a hash mismatch by construction', and doc 21 justified deferring a pinned numeric backend by asserting the core uses 'plain NumPy ops'. Both are false: Hopfield (basins/hopfield.py) and the LinOSS encoder/solver use BLAS-routed matmul (@ / np.dot), and the 5-field platform fingerprint does not capture the BLAS backend, threads, or SIMD. Two hosts with the same fingerprint but different BLAS can match-hash over divergent floats. Scope the claim in both README bullets and correct doc 21's premise; note that BLAS identity belongs in a separate diagnostic field, not the canonical pre-image. No code change.
Pins exact digests/bytes for the determinism-critical envelope surfaces so a NumPy/pickle/canonical-JSON change that silently shifts the stored byte layout fails loudly instead of passing green: - compute_post_state_hash (platform tag pinned via the override, so the vector is host-independent) - strategy_content_digest, content-addressed root_hash, full-mode snapshot_bytes - rng_state_out(default_rng(SEED)) — the pickle-of-numpy-bit-generator path the other vectors don't reach (they take rng_state_out as opaque bytes), plus a round-trip-to-seed-state check Records the blessing NumPy version (2.4.4) for self-explaining failure messages rather than hard-gating it, and carries a regeneration block + a do-not-re-bless discipline note. Verified non-tautological: tampering the platform tag fails the assertion.
…art (S3-A) Adds elume.envelope.replay(operation, scenario, n=2) -> ReplayResult(matched, hashes, outputs), re-exported from elume.envelope. Runs an op n times on one input and reports whether every post_state_hash matches — the core replay-safety contract, previously hand-rolled as a double-run assert in the quickstart. - operation accepts a registered op name (resolved) or an Operation object - ReplayResult also carries outputs so callers inspect results without re-running - n < 2 raises ValueError; a non-operation raises TypeError - README + docs/quickstart.md now call replay() instead of resolve()+run()+run(); quickstart code smoke-tested (replay matched: True) This is S3-A; the pre-image segment diff tool (Unit B) is a separate follow-on.
…S6-P1) The loop spawned len(population)-elite_k children per generation, growing ~2x/gen with no bound (measured ~131k strategies in 141s at 15 generations -- a real OOM hazard). Adds an optional max_population to evolve_one_generation (threaded through AutoStrategyEvolver) that reduces children spawned as the population nears the ceiling and lands exactly on it, then plateaus. Crucially this does NOT delete from the provider, so the immutable-past / no-dangling-parents invariant holds (covered by a test). max_population<1 raises; None (default) is uncapped and byte-identical to prior behavior. This is S6 Phase 1. Phase 2 (true truncation with a content-addressed lineage store + transitive-ancestor retention) remains a separate, deferred task.
… duplicate math (S1) elume.linoss.solver carried a verbatim duplicate of the IM/IMEX oscillator math that linoss-dynamics already owns (declared as a dependency but never imported) — two copies of the physics that could silently drift. solver.py now imports linoss-dynamics and delegates the actual state step + energy diagnostics to it. Elume keeps only the integration layer: input validation, the paper's ReLU-A clamp (the runtime does not clamp), vector-dt support (the runtime is scalar-dt only, so the diagonal system is stepped component-wise), and the 10-key metrics contract. Behavior is preserved byte-for-byte (all prior solver tests pass). - NEW tests/contract/test_linoss_runtime_parity.py: pins elume == linoss-dynamics byte-parity on the shared domain (non-neg A, scalar dt, all forcing shapes), plus the two adapter value-adds (ReLU-A clamp, vector dt). Guards against drift. - RENAME test_linoss_solver_parity.py -> _characterization.py: it never tested runtime parity (it pins Elume's metrics/energy contract); the name was a misnomer. - AGENTS.md + benchmark-report finding #1 updated to reflect real delegation. Resolves the phantom-dependency / no-delegation gap (report P0-3).
…tches (S3-B) A failed replay used to yield an opaque 64-char divergence with no way to see why. This adds segment-level diffing: - hashing.py: compute_post_state_hash now builds named pre-image segments (platform, schema_version, scenario_operation, result, result_arrays, rng_state_out, provider_snapshot, provider_snapshot_arrays). The hash is byte-identical to before (golden vectors unchanged) — it is just the concatenation of the same segments. - build_preimage() returns per-segment BLAKE2b digests; diff_preimage(a, b) reports which named segment(s) diverged (or matched). - EnvelopeOutput now carries provider_snapshot_out (frozen, default None) so a run's pre-image can be rebuilt from (input, output) without re-running. - preimage_from_envelope(input, output) pairs with replay(): build a pre-image from each mismatching run and diff them. All re-exported from elume.envelope. Verified: rebuilt pre-image hashes to the recorded post_state_hash; diffs localize platform/result/array/rng/snapshot divergence to the right segment (cross-platform branch tested via the platform override). This is S3-B; byte-offset granularity within a segment is out of scope.
The S1 commit (6c1e24b) was meant to include the solver.py delegation refactor plus the AGENTS.md and benchmark-report notes, but an atomic 'git add' failure (a stale renamed pathspec) silently dropped them, so 6c1e24b landed with only the new parity test and the test rename. This commit adds the actual delegation of the oscillator step to linoss-dynamics and the accompanying doc updates. End state is unchanged from what was tested (1271 passing, ruff clean).
|
Analysis CompleteGenerated ECC bundle from 14 commits | Confidence: 60% View Pull Request #12Repository Profile
Changed Files (78)
Top hotspots
Top directories
Analysis Depth Readiness (evidence-backed, 57%)ECC Tools uses this to decide whether recommendations should stay at commit-history/setup guidance or expand into CI, security, harness, reference-set, AI-routing, and team backlog work.
Reference Set Readiness (2/7, 29%)
Likely Future Issues (1)
Suggested Follow-up Work (1)
Copy-ready bodies db: add migration follow-up for src/elume/models/basin.py + src/elume/models/belief.py ## Summary
- Add the missing migration or schema rollout step for the recently changed schema surface.
## Why
- Backfill the missing migration artifact before another schema or model change lands on top.
## Touched paths
- `src/elume/models/basin.py`
- `src/elume/models/belief.py`
## Validation
- Create the migration or schema rollout artifact used by this repo.
- Run the repo migration / schema validation flow and verify the changed models still match production expectations.Detected Workflows (5)
Generated Instincts (28)
After merging, import with: Files
|
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.
Summary
This branch captures a clean snapshot of in-flight work plus six evidence-grounded
follow-ups that came out of an open-ended
/ideatepass over the codebase. Allwork is green: 1271 tests passing, ruff clean, byte-stability golden vectors intact.
It has two layers:
(post-audit gap-closing src+tests, doc reconciliation, the 10 component benchmark
scripts, the component benchmark audit report, the ideation artifact, plus a
.gitignoreentry for the.serenatool cache).each addressing a finding from the component benchmark audit.
Ideation follow-ups
@). Corrected both; BLAS identity belongs in a separate diagnostic field, not the hash.tests/golden/byte-stability corpus pinningpost_state_hash, content digests, snapshot bytes, and therng_state_outpickle path the other vectors miss. Records the blessing NumPy version; carries a do-not-re-bless discipline note.elume.envelope.replay(operation, scenario, n=2) -> ReplayResult(matched, hashes, outputs), re-exported; both quickstarts now call it instead of hand-rolling a double-run assert (quickstart code smoke-tested).max_populationcap on generational growth (caps children/gen, never deletes — lineage/no-dangling-parents invariant preserved). Kills the measured ~131k-strategy OOM hazard.elume.linoss.solvernow delegates the oscillator step to thelinoss-dynamicsruntime instead of carrying a verbatim duplicate of the IM/IMEX math. Thin adapter keeps validation, ReLU-A, vector-dt, and the metrics contract. Newtest_linoss_runtime_parity.pyguards against drift; renamed the misnamed old "parity" test to characterization.build_preimage/diff_preimagelocalize a hash mismatch to a named segment (platform, result, rng_state_out, provider snapshot, …);EnvelopeOutputnow carriesprovider_snapshot_out;preimage_from_envelopepairs withreplay(). Hash byte-identical (golden vectors unchanged).Notes for reviewers
follow-ups build on the snapshot). Reviewing commit-by-commit reads cleanly; happy to
split into stacked PRs if preferred.
ab1d188is a corrective commit: the S1 commit (6c1e24b) lostsolver.py+ docs toan atomic
git addfailure (stale renamed pathspec); the corrective restores them. Theon-disk code was always correct and tested — this only fixes history.
.planning/20260606-ideation-open-ended.md.Deferred (not in this PR)
linoss-dynamics, or as anisfinitecheck in the adapter).Test status