Repository navigation
Devel - #27
Devel#27
Conversation
…r decision K3 On 2026-11-01 the user chose option (b) for K3: keep the hysteresis reference originals instead of deleting them after a migration, and raise the stage storage allowance. The V1 contract capped stage artifacts at 4 GiB. Its own bounded-failure rule forbids an automatic larger budget, so the change is a new contract version, not an edit of V1. reproducibility/HysteresisReferenceContractV2.json: - copies V1 except for these intended roots; - replaces maximum_stage_artifacts_GiB = 4 with the exact byte cap maximum_stage_artifacts_bytes = 16168676163, the no-migration allowance from the OptionsK3 census, which includes Stage05 growth and one sentinel reservation; - records 17418628839 bytes as a fixed ceiling, valid only if a separately reviewed migration (condition K2) later keeps its containers; - adds supersedes and decision blocks bound to K3DecisionV1 and the user's verbatim record; - moves governance from ExecutionStateV1 to ExecutionStateV2; - bumps schema and version to v2. Every gate, tolerance, refinement rule and other resource cap is unchanged; that covers solves, wall budgets, RSS 8 GiB, workers and BLAS threads. V1 stays byte-identical as history. The hysteresis harness and the reference manifest's hi_reference_contract entry now point at V2. The 4 GiB per-run watchdog cap in the harness is a separate limit and is unchanged. The manifest's 2026-10-05 freeze receipt keeps its V1 sha256 because it records history. A new portable test locks V1's size and sha256 to V2's supersedes block. It also checks that the minimal V1->V2 differing key paths equal V2's declared changed_key_paths. Engineering authored it. Validation passed in a fresh clean clone: - test_all passed 7510, with 0 failed, 198 skipped, 7 xfailed; - static tests/ci passed 222; - the reader tests passed 198 plus 1 pre-existing strict xfail. An independent Science review (HysteresisContractV2ReviewV1, a08dc1f2 / dc96fd08) accepted it with conditions, and all six checks pass: - V2 differs from V1 only in the 8 intended roots, by its own structural diff; - the cap is exact and bound to the decision; - the repins are complete; - the lock test kills 14 of 14 mutations on Python 3.11 and 3.13; - tests/ci passed 222; - the packages job passed 1910 on each Python version. Conditions: C1, V2 takes effect once these bytes land and the receipt is recorded. C2, a K5 sentinel proof must not count the growth reserve twice on top of a fresh census. C3, K2 and K5 stay open. Constraint: user decision K3 = b, transcript line 28046, sha256 78562b63; no other cap or gate may change Rejected: editing V1 in place | V1's bounded_failure forbids automatic larger budgets and its sha256 is pinned history Confidence: high Scope-risk: narrow Directive: never add the Stage05 growth reserve on top of a fresh census in K5 proofs (review condition C2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideData structuresThe V2 hysteresis reference contract raises the stage-artifact allowance under the K3 decision while preserving V1 as pinned history, and the reference manifest records the new contract binding.
ImplementationThe hysteresis benchmark harness now loads and verifies the V2 contract without changing its separate per-run watchdog cap.
ConfigurationRepository ignore and CI-exclusion configuration are updated for the consolidated development workspace.
DocumentationThe repository guidance and README describe the current devel/AIMC layout, engineering baseline, development workflow, and outstanding qualification limits.
TestsThe hysteresis reference tests lock the superseded V1 contract bytes and verify that V2 declares exactly the changed paths.
The 2D assembly gate test now checks its frozen arrays using a checked-in fixture, while the ordered-readout test no longer relies on an external workstation artifact.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Hey - I've found 5 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/DevelopmentGuide.md" line_range="14" />
<code_context>
+With uv and Node installed, use:
+
+```sh
+uv sync --frozen --all-extras
+npm ci --prefix web
+.venv/bin/python scripts/test_all.py
</code_context>
<issue_to_address>
**Frozen setup fails on Python 3.15**
When a developer uses Python 3.15, which the documented `Python 3.11+` prerequisite permits, `uv sync --frozen --all-extras` cannot use the lock on Python 3.15 because `uv.lock` supports only versions below 3.15, so developers following the documented root setup cannot reach the test command.
Document Python 3.11–3.14 as the supported range for this locked workflow, or extend the lock to support Python 3.15.
</issue_to_address>
### Comment 2
<location path="tests/unit/assembly/test_assembly_two_dimensional.py" line_range="120-124" />
<code_context>
assert digest(candidate) == expected[name]["states"][state.name]["quantities"]
- if gate_baseline is not None:
- prefix = f"{name}__{state.name}"
- assert_bits(gate_baseline[prefix + "_u"], state.u)
- assert_bits(gate_baseline[prefix + "_F"], candidate.F)
- assert_bits(gate_baseline[prefix + "_J_data"], candidate.J.data)
- assert np.array_equal(gate_baseline[prefix + "_J_indices"], candidate.J.indices)
- assert np.array_equal(gate_baseline[prefix + "_J_indptr"], candidate.J.indptr)
+ prefix = f"{name}__{state.name}"
+ assert_bits(gate_baseline[prefix + "_u"], state.u)
</code_context>
<issue_to_address>
**Frozen parity fails off capture platform**
When the test runs on a platform or numerical stack different from the fixture's capture environment, the frozen-array assertions compare locally regenerated residual and Jacobian values directly with captured raw words on every platform, so numerical-stack differences fail the test in environments the fixture policy says are not capture environments.
Apply the repository's capture-environment guard to the raw-array comparisons, while retaining the live old-versus-new parity checks on every platform.
</issue_to_address>
### Comment 3
<location path="CLAUDE.md" line_range="7-11" />
<code_context>
+The active package lives in `src/solarlab/`, with the service in
</code_context>
<issue_to_address>
**Contributors get conflicting architecture guidance**
`CLAUDE.md` and `README.md` identify `src/solarlab/` as the active package and limit the legacy guide to legacy behavior, contradicting the stated project-tree map and authority of `perovskite-sim/CLAUDE.md`; contributors following these changes get guidance that conflicts with the required architecture reference.
Keep the repository guidance consistent with the required project-tree map and authoritative architecture guide.
Also at `README.md:50`.
</issue_to_address>
### Comment 4
<location path="scripts/benchmarks/hysteresis_reference.py" line_range="31" />
<code_context>
-CONTRACT = "reproducibility/HysteresisReferenceContractV1.json"
-CONTRACT_SHA256 = "bec9fff7f5194a81492b9697f354d460413293a84aa66667c97cf5371adf8d67"
+CONTRACT = "reproducibility/HysteresisReferenceContractV2.json"
+CONTRACT_SHA256 = "9a62e36920dd558e19c196cefed6cc191c74253db05ea54a0e1644d6a22eb96a"
ANALYTIC = "tests/numerical_contracts/AnalyticGatesV1.json"
</code_context>
<issue_to_address>
**Cited contract is misplaced**
`hysteresis_reference.py` now loads the cited hysteresis reference contract from root `reproducibility/`, rather than the required `perovskite-sim/docs/` location for cited protocol contracts; the contract therefore violates the repository's placement rule.
Place the cited contract in `perovskite-sim/docs/` and update its references accordingly.
</issue_to_address>
### Comment 5
<location path="tests/unit/assembly/test_assembly_two_dimensional.py" line_range="120-124" />
<code_context>
assert digest(candidate) == expected[name]["states"][state.name]["quantities"]
- if gate_baseline is not None:
- prefix = f"{name}__{state.name}"
- assert_bits(gate_baseline[prefix + "_u"], state.u)
- assert_bits(gate_baseline[prefix + "_F"], candidate.F)
- assert_bits(gate_baseline[prefix + "_J_data"], candidate.J.data)
- assert np.array_equal(gate_baseline[prefix + "_J_indices"], candidate.J.indices)
- assert np.array_equal(gate_baseline[prefix + "_J_indptr"], candidate.J.indptr)
+ prefix = f"{name}__{state.name}"
+ assert_bits(gate_baseline[prefix + "_u"], state.u)
</code_context>
<issue_to_address>
**Frozen 2D parity is skipped cross-platform**
When the test runs outside the recorded capture environment, `gate_baseline` depends on `frozen_digests`, whose capture-environment guard skips on a nonmatching platform before these comparisons run; the checked-in NPZ therefore does not provide the claimed platform-independent frozen parity check there, though live old-versus-new parity still runs.
Separate portable validation of the checked-in fixture from capture-environment-only floating-point oracle checks, and make any claimed cross-platform frozen comparison use a portable contract.
</issue_to_address>| With uv and Node installed, use: | ||
|
|
||
| ```sh | ||
| uv sync --frozen --all-extras |
There was a problem hiding this comment.
🟡 Medium · Frozen setup fails on Python 3.15
When a developer uses Python 3.15, which the documented Python 3.11+ prerequisite permits, uv sync --frozen --all-extras cannot use the lock on Python 3.15 because uv.lock supports only versions below 3.15, so developers following the documented root setup cannot reach the test command.
Document Python 3.11–3.14 as the supported range for this locked workflow, or extend the lock to support Python 3.15.
Prompt for AI agents
In `docs/DevelopmentGuide.md` at line 14:
**Frozen setup fails on Python 3.15**
When a developer uses Python 3.15, which the documented `Python 3.11+` prerequisite permits, `uv sync --frozen --all-extras` cannot use the lock on Python 3.15 because `uv.lock` supports only versions below 3.15, so developers following the documented root setup cannot reach the test command.
Document Python 3.11–3.14 as the supported range for this locked workflow, or extend the lock to support Python 3.15.| assert_bits(gate_baseline[prefix + "_u"], state.u) | ||
| assert_bits(gate_baseline[prefix + "_F"], candidate.F) | ||
| assert_bits(gate_baseline[prefix + "_J_data"], candidate.J.data) | ||
| assert np.array_equal(gate_baseline[prefix + "_J_indices"], candidate.J.indices) | ||
| assert np.array_equal(gate_baseline[prefix + "_J_indptr"], candidate.J.indptr) |
There was a problem hiding this comment.
🟠 High · Frozen parity fails off capture platform
When the test runs on a platform or numerical stack different from the fixture's capture environment, the frozen-array assertions compare locally regenerated residual and Jacobian values directly with captured raw words on every platform, so numerical-stack differences fail the test in environments the fixture policy says are not capture environments.
Apply the repository's capture-environment guard to the raw-array comparisons, while retaining the live old-versus-new parity checks on every platform.
Prompt for AI agents
In `tests/unit/assembly/test_assembly_two_dimensional.py` at lines 120-124:
**Frozen parity fails off capture platform**
When the test runs on a platform or numerical stack different from the fixture's capture environment, the frozen-array assertions compare locally regenerated residual and Jacobian values directly with captured raw words on every platform, so numerical-stack differences fail the test in environments the fixture policy says are not capture environments.
Apply the repository's capture-environment guard to the raw-array comparisons, while retaining the live old-versus-new parity checks on every platform.| The active package lives in `src/solarlab/`, with the service in | ||
| `src/solarlab_server/`, root `tests/`, `examples/` and `web/`. Read | ||
| [Development Guide](docs/DevelopmentGuide.md) for the current extension and | ||
| validation workflow. `perovskite-sim/` is the retained legacy engine and has | ||
| its own `CLAUDE.md`; read that guide before working on legacy behavior. |
There was a problem hiding this comment.
🟡 Medium · Contributors get conflicting architecture guidance
CLAUDE.md and README.md identify src/solarlab/ as the active package and limit the legacy guide to legacy behavior, contradicting the stated project-tree map and authority of perovskite-sim/CLAUDE.md; contributors following these changes get guidance that conflicts with the required architecture reference.
Keep the repository guidance consistent with the required project-tree map and authoritative architecture guide.
Also at README.md:50.
Prompt for AI agents
In `CLAUDE.md` at lines 7-11:
**Contributors get conflicting architecture guidance**
`CLAUDE.md` and `README.md` identify `src/solarlab/` as the active package and limit the legacy guide to legacy behavior, contradicting the stated project-tree map and authority of `perovskite-sim/CLAUDE.md`; contributors following these changes get guidance that conflicts with the required architecture reference.
Keep the repository guidance consistent with the required project-tree map and authoritative architecture guide.
Also at `README.md:50`.From CLAUDE.md L7-9:
Project trees: `perovskite-sim/` (Python simulator and backend), root `web/`
(the frontend), plus `docs/figures/`
(only the PNGs the root README embeds). **`perovskite-sim/` has its own `CLAUDE.md`** with exhaustive architecture notes (solver hot paths, TMM optics, backend SSE pattern, frontend panel structure, test BLAS-pinning gotcha, etc.). **Always read `perovskite-sim/CLAUDE.md`** — it is the authoritative guide.|
|
||
| CONTRACT = "reproducibility/HysteresisReferenceContractV1.json" | ||
| CONTRACT_SHA256 = "bec9fff7f5194a81492b9697f354d460413293a84aa66667c97cf5371adf8d67" | ||
| CONTRACT = "reproducibility/HysteresisReferenceContractV2.json" |
There was a problem hiding this comment.
⚪ Low · Cited contract is misplaced
hysteresis_reference.py now loads the cited hysteresis reference contract from root reproducibility/, rather than the required perovskite-sim/docs/ location for cited protocol contracts; the contract therefore violates the repository's placement rule.
Place the cited contract in perovskite-sim/docs/ and update its references accordingly.
Prompt for AI agents
In `scripts/benchmarks/hysteresis_reference.py` at line 31:
**Cited contract is misplaced**
`hysteresis_reference.py` now loads the cited hysteresis reference contract from root `reproducibility/`, rather than the required `perovskite-sim/docs/` location for cited protocol contracts; the contract therefore violates the repository's placement rule.
Place the cited contract in `perovskite-sim/docs/` and update its references accordingly.From CLAUDE.md L34:
Physics contract / policy / protocol / schema / certificate docs that code, tests or configs cite | `perovskite-sim/docs/`| assert_bits(gate_baseline[prefix + "_u"], state.u) | ||
| assert_bits(gate_baseline[prefix + "_F"], candidate.F) | ||
| assert_bits(gate_baseline[prefix + "_J_data"], candidate.J.data) | ||
| assert np.array_equal(gate_baseline[prefix + "_J_indices"], candidate.J.indices) | ||
| assert np.array_equal(gate_baseline[prefix + "_J_indptr"], candidate.J.indptr) |
There was a problem hiding this comment.
🟡 Medium · Frozen 2D parity is skipped cross-platform
When the test runs outside the recorded capture environment, gate_baseline depends on frozen_digests, whose capture-environment guard skips on a nonmatching platform before these comparisons run; the checked-in NPZ therefore does not provide the claimed platform-independent frozen parity check there, though live old-versus-new parity still runs.
Separate portable validation of the checked-in fixture from capture-environment-only floating-point oracle checks, and make any claimed cross-platform frozen comparison use a portable contract.
Prompt for AI agents
In `tests/unit/assembly/test_assembly_two_dimensional.py` at lines 120-124:
**Frozen 2D parity is skipped cross-platform**
When the test runs outside the recorded capture environment, `gate_baseline` depends on `frozen_digests`, whose capture-environment guard skips on a nonmatching platform before these comparisons run; the checked-in NPZ therefore does not provide the claimed platform-independent frozen parity check there, though live old-versus-new parity still runs.
Separate portable validation of the checked-in fixture from capture-environment-only floating-point oracle checks, and make any claimed cross-platform frozen comparison use a portable contract.
Summary by Sourcery
Establish the consolidated new-core development baseline with updated documentation, reproducibility contracts, and self-contained assembly validation.
New Features:
Bug Fixes:
Enhancements:
CI:
Documentation:
Tests:
Chores: