Repository navigation
Milestone B (G9P): V2 3-package cutover, SCAPS/Hysteresis alignment, perovskite-sim retirement, and V2 docs - #28
Conversation
… busy-guard count
- Surface declared vs historical-effective SCAPS and device optical coherence (inspect_scaps_optical_coherence, inspect_device_optical_coherence, BehaviorContext.optical_coherence_diagnostics, ConfigurationMigration.export, LegacyWire.export) with P08-04 ownership tag and zero optical physics or v2 PreparedDevice word changes (P03-04). - Represent complete AST-pinned R1 implicit material behavior flags in inspect_r1_material_behavior and BehaviorContext(driver="r1_material"), fixing MULTIVALENT_VERSION QF-DC detection and guarding LegacyExecutionContext, ExecutionEngine, and IdentityInputs to require R1ExecutionContext (P03-04, P03-05). - Propagate tandem subcell diagnostics in migrate_configuration and synchronize SCAPS bulk_defects / scaps_defect_metadata edits (single-field edits, singular-to-plural promotion, clear, N_peak_cm3 edits, and conflict guards) in prepare_legacy_wire (P03-06, P03-07). - Update PublicAPI.json for solarlab.config.behavior and add regression tests across behavior, migration/wire roundtrip, cache/binding invalidation, and target-profile release/historical provenance verification (P03-01..07).
…ction under interface-level trust (M-only)
- P05-02b: genuine DC Suns-V_oc (suns_voc.py), cold temperature-rebound V_oc(T) (voc_t.py), DC dark J-V with curvature-window diode extraction (dark_jv.py), and Backward Euler piecewise/triangular waveform J-V with displacement-inclusive PV/conjugate current reporting (waveform_jv.py). - P05-03a: small-signal AC C-f / C-V / Mott-Schottky with apparent_built_in_voltage_V, active vs frozen ionic modes, and inductive/0-Hz refusal (mott_schottky.py); monochromatic EQE with closed PhotonBudget and J_sc_eqe_A_m2 (eqe.py); and Rau reciprocity EL spectrum with radiative vs total recombination decomposition (el_spectrum.py). - Add T1/T2/T4 analytic, coupled-ionic, and perovskite_sim parity test suites across 5 test modules.
…iments, and P06-03 4-axis refinement
…al_public_imports
…, and catalog dispatch [M] - P06-07: add startup SHA-256 schema/registry handshake verification (`schema-handshake.ts`) across `/configuration-schema` and `/experiments` (`X-Solarlab-Registry`, `X-Solarlab-Job-Schema`, `ETag`, payload digest), rendering an explicit `[role="alert"]` mismatch banner and mounting `ConfigurationWorkstation` across all 5 canonical preparation modes (`device`, `tandem`, `jv`, `spatial`, `sweep`). - P06-07: propagate stable-ID renames and surface dangling-reference, topology-order, duplicate-ID, duplicate-contact-side, and sweep-axis target diagnostics in `device-edits.ts`, `device-editor.ts`, and `sweep.ts`, with lossless round-trip regression coverage for spatial defect profiles, composition grading, n-k optical resources, and 2T tandem stacks. - P06-08: replace frontend `TIER_FLAGS` / `deviceSnapshot.device.mode` post-run physics guessing with backend execution-manifest receipt extraction (`execution-physics.ts`), surfacing `scientific_qualification === false` (`Unqualified · Engineering Preview`) and explicit diagnostic banners/badges for failed sweep/trajectory points, non-identifiable `tau === null` + `non_identifiable_reason`, and unbracketed/invalid `V_oc`. - P06-08: replace hardcoded experiment switch/union dispatch with declarative `EXPERIMENT_CATALOG` + plot renderer catalog and delete unreachable legacy modules (`panels/degradation.ts`, `panes/current-decomp-pane.ts`, `panes/spatial-pane.ts`).
…n experiments
- P04-13 external circuit, thermal balance, electrothermal, and 2T tandem:
- external_circuit.py: post-processing and strict self-consistent forward/reverse
monotone J-V wrappers for R_series and R_shunt without altering bulk PDEs.
- thermal_balance.py: 0D module energy balance (Q_in = P_elec + Q_conv + Q_rad),
convective/radiative linearized derivatives, and Brent equilibrium T_eq solver.
- electrothermal.py: fresh-state-per-temperature isothermal J-V family (steady_jv
and transient_jv_strict with mobile ions) and bracketed Brent operating-point
energy-balance closure across device_plus_lumped_parasitics.
- tandem_jv.py: full-stack joint TMM optics across [top, junction, bottom,
back_reflector] with spectral photon-budget closure and parasitic exclusion,
per-subcell electrical compilation with distinct identities, and Kirchhoff
series-matched 2T J-V synthesis.
- P05-04a charge-conserving open-circuit, TPV, and degradation snapshots:
- open_circuit.py: bordered sparse (M + 1) floating-terminal Backward Euler
integrator enforcing Gauss-Maxwell total port current I_carrier + I_ion + dD/dt = 0
on all faces and telescoping port-charge conservation.
- tpv.py: explicit steady (ion-free) or finite-time soaked (mobile-ion)
preconditioning, paired pulsed vs unpulsed control subtraction on identical
time grids, and gated single-exponential decay extraction refusing truncated,
non-monotonic, or multi-exponential traces.
- degradation.py: frozen-ion electronic snapshot J-V sweeps preserving exact
pointwise ion densities across all single/dual/shared-site species and
coupled irreversible stress-damage absorber rebind snapshots.
- Add 18 unit, integration, conservation, and live legacy-parity tests.
…tifiability/solarscale
…sheet-charge closures onto unified assembly (P04-09)
…unded WKB tunnelling onto unified assembly (P04-12)
…d metastable 1D defects plus defect/ion AC, C-f, and transients onto unified assembly (P04-10, P05-03b, P05-04b)
…namic charge-closure refusals (P04-10, P05-03b, P05-04b)
- Eliminate O(1e-11..1e-9 A/m^2/V) floating-point cancellation in dark 0 V
and low-bias small-signal AC on both p-i-n and n-i-p across bulk-defect,
two-sided interface-defect, and coupled defect+ion stacks:
* Lift the small-signal unknown along MOVING_LIFT (dV on the positive
electrode and adjacent transport layer) so cross-face Scharfetter-Gummel
tangents avoid O(1/V_T) contact-potential subtraction.
* Add direct quasi-Fermi IFT sensitivities (*_qf, *_common_qf) and exact
flux-sum stabilization in two_sided.py so two-sided trace tangents avoid
stiff-side common-mode (O(1e24 - 1e24)) cancellation.
* Tighten default AC FrequencyOptions relative_tolerance to 1e-14 with
iterative refinement and retain exact ion inventory conservation across
all frequencies f >= 0.
- Compute DefectIonImpedanceResult.maximum_maxwell_spread_A_m2_V over the
Maxwell-conserving sweeps (coupled, frozen_ions) and document asymptotic
frozen-trap closures.
- Enforce pre-solve CapabilityError refusals for neutral bulk defects under
dynamic_bulk_defects=True and non-equilibrium_referenced interface charge
closure under dynamic_interface_defects=True across compile, impedance,
and transient entry points.
- Add dark 0 V p-i-n and n-i-p AC passivity, 0 Hz FD slope, Maxwell spread,
and capability refusal regression tests.
…on step guards (#128) - Look up electronic contact exchanges via (ELECTRON/HOLE, side) and preserve CarrierExchange's +x outward_normal sign on both contacts in steady DC and BDF step accounting (dynamic_defects_1d.py). - Require at least one Newton step for nonzero initial residuals and tighten post-step residual fallback in _damped_newton_solve and _solve_bdf_step_newton so doped selective-contact stacks converge to step tolerance before exit. - Add selective (S_n, S_p) and blocking contact regression tests on both p-i-n and n-i-p orientations across DC, dark 0 V FD impedance, and BDF2 transient.
…d JV hint authority
…acitance (P08-02a)
…act gate checks (P08-03)
…dget, and SCAPS stress certification (P08-04)
…interface verification to solarlab_research (P07-01, P07-02)
…G8 closeout (P08-05)
…lone CLI, and exclude perovskite-sim from target wheel/sdist (P09-01)
…on lock to V2 solarlab
- Sever all production imports of solarlab_server.legacy_engine from
job_service, registered_worker, app, and routes/legacy while retaining
legacy_engine/__init__.py on disk for P09-03 retirement boundary checks.
- Narrow JobSubmission.engine to Literal['solarlab'], default worker_binding
to engine='solarlab', retire POST /api/jobs and synchronous POST /api/*
with HTTP 410, and preserve 100% solver-free historical RunStore readback
(legacy_result + GET /api/jobs/{id}/events & /result) with zero legacy
imports.
- Add SPA _web_dist static asset serving in create_app and add
solarlab_server.cli:main with single-thread BLAS and assembled equation
enforcement.
- Lock production worker preparation and verify_selection in
solarlab.equations.implementation to 'assembled' (retiring
NEWCORE_EQUATIONS=legacy in worker/server execution while preserving
explicit in-process equation_implementation(LEGACY) for unit parity tests).
- Cut over web workstation, panels, and Vite/Docker configs from legacy
/api/* endpoints to V2 solarlab_server endpoints (v2-workstation-client,
v2-job-client, /configs, /materials, /configuration-preview/*, /experiments,
/jobs, /runs/.../events, /results/...), preserving UNQUALIFIED badges.
…and BDF allowlist pins
…_1d preset resolution
…nd add RetiredModelsV1 (P09-03)
…ture and Round 2 alignment refinement
…n ramp on steep SCAPS spikes
…ry layout
- Remove legacy /perovskite-sim/ tree (1,049 files), expired transition manifests,
obsolete prototype scripts, and pure legacy-parity test modules (pre-slim snapshot
anchored at local tag archive/pre-slim-be973ac5).
- Untrack local .claude/ skills and skills-lock.json (491 files) via .gitignore
while keeping local files intact on disk.
- Promote active non-code assets to canonical top-level paths:
- tests/fixtures/configs/ (52 YAML device test fixtures)
- docs/contracts/ (34 active physics/protocol contract documents)
- reproducibility/{AnalyticGatesV1.json,ScapsParams.xlsx}
- web/src/workstation/panes/__fixtures__/IonDiffusivityFigureReference.json
- Migrate remaining unit, integration, refactor, runtime, CI, and benchmark helpers
onto packaged solarlab.materials resources with zero changes to src/.
- Update CLAUDE.md, README.md, docs/DevelopmentGuide.md, docs/RetiredModelsV1.md,
pyproject.toml, .github/workflows/ci.yml, and .dockerignore.
…cros, and refresh Arial figures - Rewrite root README.md, examples/research_1d/README.md, and examples/research_2d/README.md (2,313 -> 584 lines across those three, eliminating cross-path duplication and updating all architecture, solver, and 262-case SCAPS / 45-case hysteresis benchmark summaries to V2). - Add structured index READMEs for docs/contracts/ (34 specifications) and reproducibility/ (6 frozen contracts and benchmark drivers). - Fix GitHub MathJax macro errors (\operatorname -> \mathrm, \choose -> \binom, and standalone multi-line 97238 fences) across README.md and docs/**/*.md, and enforce macro/link checks in tests/ci/test_markdown_contracts.py. - Add scripts/generate_readme_figures.py enforcing strict native Arial typography at 300 DPI and replace 9 legacy figures with 5 V2 core figures (ArchitectureFlowV2, DevicePhysicsOverviewV2, SolverTopologyV2, ValidationScapsOverviewV2, ValidationHysteresisOverviewV2).
There was a problem hiding this comment.
Sorry @ShaneLogic, this pull request is too large to review
It changes 2,113 files. Sourcery can review pull requests with up to 300 changed files.
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d21fa46f92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| export async function startJob( | ||
| kind: DispatchableJobKind, | ||
| _device: unknown, |
There was a problem hiding this comment.
Use the selected device when submitting a run
When a workstation user runs with a configuration other than the route’s first registered device, the panes call startJob without configPath, so selectRouteDevice(..., null, ...) chooses ids[0] and this _device argument is ignored. The server therefore simulates its first registered device while the run is saved with the user’s selected deviceSnapshot, silently associating results with the wrong model. Bind the submission to the active configuration or reject it when that configuration is not installed.
Useful? React with 👍 / 👎.
| if (kind === 'jv' || kind === 'dark_jv') { | ||
| selectedEntry = bindings.find( | ||
| b => b.engine === 'solarlab' && b.driver === 'steady_jv' && b.scope === STEADY_SCOPE, | ||
| ) |
There was a problem hiding this comment.
Reject transient J–V selections on the steady route
When a user runs a plain J–V sweep with the pane’s default Transient (Radau) selection, the pane passes params.solver here but this branch selects steady_jv solely from kind; the submitted payload then contains only a voltage grid and drops the solver and scan-rate settings. The run is reported as the selected transient experiment even though it is a static sweep, losing dynamic and hysteresis effects without warning. Route supported solver modes to matching V2 drivers or reject unsupported selections before accepting the run.
Useful? React with 👍 / 👎.
Summary
This PR delivers the complete Waves 3–4 architecture refactor (
G9P), two-round first-principles SCAPS-1D & Mobile-Ion Hysteresis alignment, complete retirement of the legacy/perovskite-sim/directory, and the V2 documentation & pure-Arial figure overhaul (46commits,+101,824 / -677,602lines across2,108files).1. Unified V2 3-Package Product & Workstation Cutover (
P04–P09,G9P)src/:solarlab(0.1.0): Core 1D/2D coupled semiconductor-ionic-defect drift-diffusion engine, log-activity sparse assembler, packagedDefaultCatalog, optical(n, k)resources, presets, andsolarlabCLI (solarlab check-install --require-no-legacy,solarlab steady-jv).solarlab_server: FastAPI/SSE workstation service, SQLiteRunStore, schema-bound configuration preview, and isolated worker execution (solarlab-server).solarlab_research: Decoupled multi-precision/interval qualification & research drivers (solarlab-cbo-scan,solarlab-r1-short-window,solarlab-r1-verify-sources).P04-10,P05-03b,P05-04b) and prospective V2 physics closures (P08-01..P08-05): sub-face series dielectric capacitance, half-endpoint control-volume geometry, reciprocal unequal-DOS thermionic emission, and spectral control-volume Beer–Lambert optics.web/React/TypeScript SPA cutover (P09-02) onto V2solarlabconfiguration schemas and server endpoints, with zero legacyperovskite_simorbackendimports enforced byimport-linter(12/12contracts).2. First-Principles SCAPS-1D & Dynamic Hysteresis Alignment (Zero Fudge Factors)
ScapsComparisonContractV1.json):interface_band_reference_mode='scaps_interface_extrema'and analytical 7-level untruncated Gauss–Hermite interface trap quadrature (SCAPS_GAUSSIAN_INTERFACE_QUADRATURE) with exact Kirchhoff balance and analytical IFT Jacobians (0-ULP change on defaultsingle_levelpath).94.0%(233/248) achieve|ΔVoc| <= 30 mV, median|ΔVoc| = 11.7 mV(+1.91 mVonscaps_base), P90|ΔVoc| = 25.93 mV, median|ΔFF| = 0.53%, median|ΔPCE| = 0.20%.HysteresisReferenceContractV2.json):ion_steric_diffusion_only=False), dual-mesh absorber generation, and exact-conserving geometric Backward Euler substeps.|ΔHI_norm| = 5.6e-4(95.6%<= 5e-3), max relative mobile-ion inventory drift<= 1.80e-13.3. Legacy
/perovskite-sim/Retirement & Repository Slimming/perovskite-sim/(1,049files) and untracked local.claude/+skills-lock.jsonvia.gitignore, reducing tracked files from2,654to1,024(-674klines).docs/contracts/,reproducibility/,tests/fixtures/configs/), documented retired closures indocs/RetiredModelsV1.md, and preserved the pre-slim snapshot at tagarchive/pre-slim-be973ac5(be973ac5e1aa46c5c21eaa79c42b402d25a76eb3).4. V2 README Hierarchy, GitHub MathJax Macro Guard & Pure-Arial Figures
README.md,examples/research_1d/README.md,examples/research_2d/README.md,docs/contracts/README.md, andreproducibility/README.md(2,313->676lines total, eliminating cross-path duplication and covering all 10 2D modules).\operatorname,\choose, single-line$$) and addedtests/ci/test_markdown_contracts.pystatic guard.scripts/generate_readme_figures.pygenerating 5 native-Arial (300 DPI) V2 architecture/physics/validation figures underdocs/figures/.Scope & Scientific Governance Boundary
scientific_qualification = False, frozen reference contract thresholds remain unmodified, and decoupledRS-G7(R1100 sL2/L3) research certification remains on its independent track.Verification
Refactor checks(develHEADd21fa46) — 9/9 Jobs Green:static,binding,frontend(Vitest963 passed + Vite production build),core(3.11.16&3.13.15),packages(3.11.16&3.13.15includingruff,mypyacross 314 files, schema check, release-bundle wheel/sdist build, and outside-checkout import check), andbackend(3.11.16&3.13.15including isolatedscan_executionandsupervisor_control_failurepools).