Skip to content

Add native zero-fit SCAPS PVK-xy preset/benchmark and remove V2 branding from READMEs & figures - #29

Merged
ShaneLogic merged 1 commit into
mainfrom
devel
Nov 23, 2026
Merged

ShaneLogic merged 1 commit into
mainfrom
devel

Conversation

@ShaneLogic

@ShaneLogic ShaneLogic commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Updates the repository presets, reproducibility assets, and documentation with the verbatim partner SCAPS 3.3.10 zero-fit baseline (PVK-xy.scaps + AM1_5G 1 sun.spe), and removes hardcoded V2 version labels across all README prose and figures (src/solarlab/ solver code unchanged; scientific_qualification = False).

Key Changes

  1. Packaged Native Zero-Fit SCAPS Preset (scaps_pvk_xy)
    • Added src/solarlab/materials/data/presets/scaps_pvk_xy.{yaml,device.json,v2.json} encoding verbatim PVK-xy.scaps parameters (het_recomb_despike = 0, recalculated semiconductor flat-band contacts, Nc = 2.0e18 / Nv = 1.8e19 cm^-3, mu_p = 2.0 cm^2/(V s), Nd = 1.0e12 cm^-3, Et = 0.30 eV above highest EV, zero calibration factors), registered in packaged.py and web/src/preset-catalog.ts alongside retained scaps_mirror_v2.
  2. Native SCAPS Spectrum & 262-Case Benchmark Driver
    • Added reproducibility/ScapsAm15g1Sun.spe (sha256: e357f1237fe82182...) and scripts/benchmarks/scaps_native_pvk_xy.py.
    • Across all 262 cases (262/262 converged, 0 failed): 221 / 248 (89.1%) numeric reference points pass all 4 strict ScapsComparisonContractV1 pointwise gates simultaneously (100% pass in 11/14 groups including 56-case 2D scaps_nt_et), with median |ΔVoc| = 0.60 mV (95.2% <= 2 mV), median |ΔJsc| = 0.0088 mA/cm², median |ΔFF| = 0.031%, and median |ΔPCE| = 0.009%.
  3. Versionless README Prose & Pure-Arial Figures (300 DPI)
    • Removed explicit V2 version branding from README.md, examples/research_1d/README.md, docs/contracts/README.md, reproducibility/README.md, and scripts/generate_readme_figures.py (retaining literal on-disk contract/preset filenames).
    • Replaced docs/figures/*V2.png with versionless 300 DPI native-Arial figures (ArchitectureFlow.png, DevicePhysicsOverview.png, SolverTopology.png, ValidationScapsOverview.png, ValidationHysteresisOverview.png).

Verification

Summary by Sourcery

Add a native zero-fit SCAPS PVK-xy benchmark and update repository documentation and figures to use version-neutral branding.

New Features:

  • Add the native zero-fit scaps_pvk_xy preset with packaged device definitions and web catalog metadata.
  • Add the native SCAPS spectrum and a reproducible 262-case benchmark driver for alignment against the partner baseline.

Enhancements:

  • Update SCAPS validation reporting and figures to reflect the native zero-fit benchmark results while retaining the historical mirror preset.
  • Remove non-contract V2 branding from README content, figure names, generated artwork, and related descriptions.

Documentation:

  • Refresh README and reproducibility documentation with the new preset, benchmark assets, validation results, and versionless figure references.

Tests:

  • Extend packaged preset and input-closure tests to cover the new native SCAPS preset.

Chores:

  • Replace README figures with versionless 300-DPI Arial-rendered assets.

@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Add the packaged scaps_pvk_xy preset data encoding the partner’s native zero-fit device parameters.

  • src/solarlab/materials/data/presets/scaps_pvk_xy.device.json L1-274
  • src/solarlab/materials/data/presets/scaps_pvk_xy.v2.json L1-290
  • src/solarlab/materials/data/presets/scaps_pvk_xy.yaml L1-127

Add the native SCAPS spectrum asset used as the benchmark illumination source.

  • reproducibility/ScapsAm15g1Sun.spe L1-136

API

Register the new preset with the packaged material catalog and shipped preset list.

  • src/solarlab/materials/packaged.py L81, L88

Expose the native SCAPS preset in the frontend research preset catalog and describe its behavior.

  • web/src/preset-catalog.ts L16-27

Implementation

Implement the native 262-case SCAPS benchmark driver, including spectrum/resource construction, parameter sweeps, solver execution, and scorecard generation.

  • scripts/benchmarks/scaps_native_pvk_xy.py L1-531

Update README figure generation to use the native benchmark results and emit versionless figures.

  • scripts/generate_readme_figures.py L1-6, L109-137, L765-808 (+25 small edits)

UI

Add the new preset to the frontend preset catalog tests and verify its label and preferred mode.

  • web/src/preset-catalog.test.ts L14, L20, L34-36

Configuration

Replace the root README’s embedded V2 figure assets with versionless figures and update figure naming guidance.

  • docs/figures/ArchitectureFlow.png
  • docs/figures/ArchitectureFlowV2.png
  • docs/figures/DevicePhysicsOverview.png
  • docs/figures/SolverTopology.png
  • docs/figures/SolverTopologyV2.png
  • docs/figures/ValidationHysteresisOverview.png
  • docs/figures/ValidationHysteresisOverviewV2.png
  • docs/figures/ValidationScapsOverview.png
  • docs/figures/ValidationScapsOverviewV2.png

Documentation

Document the native zero-fit SCAPS benchmark results, add the preset to the experiment matrix, and remove V2 branding from root README prose and figure references.

  • README.md L49-52, L222-236 (+7 small edits)

Remove V2 wording from the research examples README guidance.

  • examples/research_1d/README.md L5

Remove the V2 descriptor from the resolved intraband contract listing while retaining its versioned filename.

  • docs/contracts/README.md L17

Document the new spectrum and native benchmark driver and distinguish it from the historical SCAPS contract runner.

  • reproducibility/README.md L3, L13-15, L24-26

Remove V2 branding from the project guidance for README-embedded figure filenames.

  • CLAUDE.md L46

Tests

Update the input-domain closure test for the additional packaged preset input.

  • tests/refactor/test_input_domain_closure.py L42-46, L87

Include the new preset in packaged resource and preset-loading assertions.

  • tests/unit/materials/test_packaged_resources_and_cli.py L96-101

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T09:35:01.636048Z fc0f27a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc0f27aec9

ℹ️ 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".

Comment on lines +304 to +305
if ref_status == "reference_missing" or ref_values is None:
disposition = "reference_missing"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count solver failures before marking references missing

If any of the 14 reference_missing cases fails to compile or solve, this branch still records it as reference_missing instead of solver_failed. The aggregate failure count can therefore stay at zero and support the README’s 262/262 cases converged claim even when a case did not converge. Preserve the missing-reference status separately, but count solver failures before applying it.

Useful? React with 👍 / 👎.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 8 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="scripts/benchmarks/scaps_native_pvk_xy.py" line_range="304-307" />
<code_context>
+
+    elapsed_s = time.perf_counter() - t0
+    metric_comparisons: dict[str, Any] = {}
+    if ref_status == "reference_missing" or ref_values is None:
+        disposition = "reference_missing"
+    elif solver_error is not None or cand_metrics is None:
+        disposition = "solver_failed"
+    else:
+        all_passed = True
</code_context>
<issue_to_address>
**Failed cases count as converged**

When a case with `reference_status == "reference_missing"` fails to solve, `_eval_case` assigns `reference_missing` before checking `solver_error`, so the failed case is omitted from `solver_failed` and the summary can report all 262 cases converged when some did not.

Check for `solver_error` or missing candidate metrics before assigning the `reference_missing` disposition.
</issue_to_address>

### Comment 2
<location path="scripts/benchmarks/scaps_native_pvk_xy.py" line_range="525" />
<code_context>
+        "cases": rows,
+    }
+    args.output.parent.mkdir(parents=True, exist_ok=True)
+    args.output.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
+    print(json.dumps({"summary_counts": counts, "wall_s": round(wall_s, 2)}, indent=2))
+    return 0
</code_context>
<issue_to_address>
**Scorecards are lost or corrupted**

When the process is interrupted during saving or two runs share an output path, `args.output.write_text` truncates the destination before the JSON is complete, and concurrent runs can overwrite or interleave scorecards, leaving an empty, invalid, or lost result.

Write to a unique temporary file and atomically replace the destination, and reject or otherwise isolate concurrent writes to the same output path.

Also at `scripts/benchmarks/scaps_native_pvk_xy.py:357`.
</issue_to_address>

### Comment 3
<location path="reproducibility/README.md" line_range="24" />
<code_context>
+| [../scripts/benchmarks/scaps_native_pvk_xy.py](../scripts/benchmarks/scaps_native_pvk_xy.py) | Native zero-fit SCAPS-1D 262-case driver (`scaps_pvk_xy.yaml` + `ScapsAm15g1Sun.spe`, `89.1%` all-4-gate pass, median $\lvert\Delta V_{\mathrm{oc}}\rvert = 0.60\text{ mV}$) |
</code_context>
<issue_to_address>
**Benchmark assets missing from sdist**

When a user obtains SolarLab from the source distribution rather than a repository checkout, the source distribution’s explicit `only-include` list in `pyproject.toml` omits both `scripts/benchmarks/scaps_native_pvk_xy.py` and `reproducibility/ScapsAm15g1Sun.spe`, so users following this documented driver entry from an sdist cannot run the benchmark.

Include the new benchmark script and spectrum in the sdist, or document that the benchmark requires a full repository checkout.
</issue_to_address>

### Comment 4
<location path="src/solarlab/materials/data/presets/scaps_pvk_xy.yaml" line_range="49" />
<code_context>
+    N_D_cm3: 0.0
+    N_A_cm3: 1.0e18
+    v_th_cm_s: 1.0e7
+    optical_material: spiro_OMeTAD
+    bulk_defects:
+      - name: SAM-CB
</code_context>
<issue_to_address>
**Spectral preset lacks a spectrum**

When a caller selects TMM or spectral Beer–Lambert for the packaged `scaps_pvk_xy` preset, the packaged preset declares optical materials but no spectrum; normal preset loading does not add one, and the 1D compiler rejects TMM or spectral Beer–Lambert compilation without an explicit spectrum, so callers cannot use the preset in those optical modes.

Declare `spectrum: am15g` in the preset and regenerate its packaged device and configuration documents.
</issue_to_address>

### Comment 5
<location path="src/solarlab/materials/data/presets/scaps_pvk_xy.yaml" line_range="49-108" />
<code_context>
+    optical_material: spiro_OMeTAD
</code_context>
<issue_to_address>
**Preset does not reproduce benchmark optics**

When a caller selects `scaps_pvk_xy` outside the benchmark driver, when callers run the packaged preset through the normal CLI or workstation, its `spiro_OMeTAD`, `MAPbI3`, and `C60` optical materials remain in effect, and the packaged spectrum is used. Only `scaps_native_pvk_xy.py` replaces those materials and the spectrum with the native SCAPS tables, so ordinary runs of the preset do not reproduce the benchmark’s optical conditions or its reported metrics.

Make the native optical resources available through normal preset resolution, or clearly separate and label the benchmark-only optical setup so selecting the preset does not imply benchmark parity.

Also at `scripts/benchmarks/scaps_native_pvk_xy.py:109-111`.
</issue_to_address>

### Comment 6
<location path="scripts/benchmarks/scaps_native_pvk_xy.py" line_range="360-361" />
<code_context>
+        default=REPO_ROOT / "outputs" / "scaps_native_pvk_xy_262.json",
+        help="Destination JSON path for full per-case scorecard.",
+    )
+    parser.add_argument("--workers", type=int, default=4)
+    parser.add_argument("--max-cases", type=int, default=None)
+    args = parser.parse_args(argv)
+
</code_context>
<issue_to_address>
**Invalid CLI limits fail unclearly**

When the caller supplies `--workers <= 0` or `--max-cases < 0`, when `--workers` is zero or negative, `ProcessPoolExecutor` raises an uncaught `ValueError`; a negative `--max-cases` silently uses Python’s negative slice and runs an unintended subset. Callers get a traceback or misleading benchmark output instead of a clear argument error.

Validate the limits immediately after parsing and report invalid values through `parser.error`.

Also at `scripts/benchmarks/scaps_native_pvk_xy.py:362`.
</issue_to_address>

### Comment 7
<location path="scripts/generate_readme_figures.py" line_range="738" />
<code_context>
-        1.24,
-        "Cliff & spike trend aligned\nacross [−1.0, +0.5] eV",
+        1.20,
+        "Native zero-fit parity\nMed |Δ$V_{\\mathrm{oc}}$| = 0.53 mV",
         fontsize=8.6,
         color=C_MUTED,
</code_context>
<issue_to_address>
**Benchmark accuracy results conflict**

When a reader compares the generated validation figure with the README benchmark summary, the figure reports median `|ΔVoc| = 0.53 mV` while the README reports `0.60 mV` across the same 248 numeric cases, so readers see inconsistent benchmark results.

Use the same median value in the generated figure and README benchmark summary.

Also at `README.md:230`.
</issue_to_address>

### Comment 8
<location path="scripts/generate_readme_figures.py" line_range="448" />
<code_context>

-    out = OUT_DIR / "ArchitectureFlowV2.png"
+    out = OUT_DIR / "ArchitectureFlow.png"
     fig.savefig(out, dpi=DPI, bbox_inches="tight", pad_inches=0.12, facecolor="white")
     plt.close(fig)
     return out
</code_context>
<issue_to_address>
**Regenerated figures lose versioned history**

When the README figures are regenerated, `generate_architecture_flow` and the other four generators write versionless filenames, while the README links to those same paths, so regenerated figures reuse their names instead of preserving a new `V<n>` edition.

Write each regenerated figure under a new `V<n>` filename and update the README links to those files.

Also at `scripts/generate_readme_figures.py:599`, `scripts/generate_readme_figures.py:712`, `scripts/generate_readme_figures.py:809`, `scripts/generate_readme_figures.py:886`, `README.md:59`, `README.md:168`, `README.md:213`, `README.md:225`, `README.md:237`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +304 to +307
if ref_status == "reference_missing" or ref_values is None:
disposition = "reference_missing"
elif solver_error is not None or cand_metrics is None:
disposition = "solver_failed"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Failed cases count as converged

When a case with reference_status == "reference_missing" fails to solve, _eval_case assigns reference_missing before checking solver_error, so the failed case is omitted from solver_failed and the summary can report all 262 cases converged when some did not.

Check for solver_error or missing candidate metrics before assigning the reference_missing disposition.

Prompt for AI agents
In `scripts/benchmarks/scaps_native_pvk_xy.py` at lines 304-307:

**Failed cases count as converged**

When a case with `reference_status == "reference_missing"` fails to solve, `_eval_case` assigns `reference_missing` before checking `solver_error`, so the failed case is omitted from `solver_failed` and the summary can report all 262 cases converged when some did not.

Check for `solver_error` or missing candidate metrics before assigning the `reference_missing` disposition.

"cases": rows,
}
args.output.parent.mkdir(parents=True, exist_ok=True)
args.output.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Scorecards are lost or corrupted

When the process is interrupted during saving or two runs share an output path, args.output.write_text truncates the destination before the JSON is complete, and concurrent runs can overwrite or interleave scorecards, leaving an empty, invalid, or lost result.

Write to a unique temporary file and atomically replace the destination, and reject or otherwise isolate concurrent writes to the same output path.

Also at scripts/benchmarks/scaps_native_pvk_xy.py:357.

Prompt for AI agents
In `scripts/benchmarks/scaps_native_pvk_xy.py` at line 525:

**Scorecards are lost or corrupted**

When the process is interrupted during saving or two runs share an output path, `args.output.write_text` truncates the destination before the JSON is complete, and concurrent runs can overwrite or interleave scorecards, leaving an empty, invalid, or lost result.

Write to a unique temporary file and atomically replace the destination, and reject or otherwise isolate concurrent writes to the same output path.

Also at `scripts/benchmarks/scaps_native_pvk_xy.py:357`.

Comment thread reproducibility/README.md
|:-------|:--------|
| [../scripts/benchmarks/p09_candidate_validation.py](../scripts/benchmarks/p09_candidate_validation.py) | Isolated-wheel candidate validation across SCAPS 262, Hysteresis 45, and performance cases |
| [../scripts/benchmarks/scaps_reference.py](../scripts/benchmarks/scaps_reference.py) | Standalone SCAPS-1D 262-case suite runner & scorecard generator |
| [../scripts/benchmarks/scaps_native_pvk_xy.py](../scripts/benchmarks/scaps_native_pvk_xy.py) | Native zero-fit SCAPS-1D 262-case driver (`scaps_pvk_xy.yaml` + `ScapsAm15g1Sun.spe`, `89.1%` all-4-gate pass, median $\lvert\Delta V_{\mathrm{oc}}\rvert = 0.60\text{ mV}$) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Benchmark assets missing from sdist

When a user obtains SolarLab from the source distribution rather than a repository checkout, the source distribution’s explicit only-include list in pyproject.toml omits both scripts/benchmarks/scaps_native_pvk_xy.py and reproducibility/ScapsAm15g1Sun.spe, so users following this documented driver entry from an sdist cannot run the benchmark.

Include the new benchmark script and spectrum in the sdist, or document that the benchmark requires a full repository checkout.

Prompt for AI agents
In `reproducibility/README.md` at line 24:

**Benchmark assets missing from sdist**

When a user obtains SolarLab from the source distribution rather than a repository checkout, the source distribution’s explicit `only-include` list in `pyproject.toml` omits both `scripts/benchmarks/scaps_native_pvk_xy.py` and `reproducibility/ScapsAm15g1Sun.spe`, so users following this documented driver entry from an sdist cannot run the benchmark.

Include the new benchmark script and spectrum in the sdist, or document that the benchmark requires a full repository checkout.

N_D_cm3: 0.0
N_A_cm3: 1.0e18
v_th_cm_s: 1.0e7
optical_material: spiro_OMeTAD

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Spectral preset lacks a spectrum

When a caller selects TMM or spectral Beer–Lambert for the packaged scaps_pvk_xy preset, the packaged preset declares optical materials but no spectrum; normal preset loading does not add one, and the 1D compiler rejects TMM or spectral Beer–Lambert compilation without an explicit spectrum, so callers cannot use the preset in those optical modes.

Declare spectrum: am15g in the preset and regenerate its packaged device and configuration documents.

Prompt for AI agents
In `src/solarlab/materials/data/presets/scaps_pvk_xy.yaml` at line 49:

**Spectral preset lacks a spectrum**

When a caller selects TMM or spectral Beer–Lambert for the packaged `scaps_pvk_xy` preset, the packaged preset declares optical materials but no spectrum; normal preset loading does not add one, and the 1D compiler rejects TMM or spectral Beer–Lambert compilation without an explicit spectrum, so callers cannot use the preset in those optical modes.

Declare `spectrum: am15g` in the preset and regenerate its packaged device and configuration documents.

Comment on lines +49 to +108
optical_material: spiro_OMeTAD
bulk_defects:
- name: SAM-CB
sigma_n_cm2: 1.0e-15
sigma_p_cm2: 1.0e-15
N_t_cm3: 1.0e6
E_t_eV_below_cb: 0.10
distribution: single
- name: SAM-VB
sigma_n_cm2: 1.0e-15
sigma_p_cm2: 1.0e-15
N_t_cm3: 1.0e6
E_t_eV_above_vb: 0.10
distribution: single

- name: SCAPS_PVK
role: absorber
thickness_nm: 800.0
E_g_eV: 1.53
chi_eV: 3.94
eps_r: 31.0
mu_n_cm2: 20.0
mu_p_cm2: 2.0
N_C_cm3: 2.0e18
N_V_cm3: 1.8e19
N_D_cm3: 1.0e12
N_A_cm3: 0.0
v_th_cm_s: 1.0e7
B_rad_cm3_s: 1.0e-12
C_n_cm6_s: 2.3e-29
C_p_cm6_s: 2.3e-29
optical_material: MAPbI3
bulk_defects:
- name: Perovskite-CB
sigma_n_cm2: 1.0e-15
sigma_p_cm2: 1.0e-15
N_t_cm3: 1.0e12
E_t_eV_below_cb: 0.10
distribution: single
- name: Perovskite-VB
sigma_n_cm2: 1.0e-15
sigma_p_cm2: 1.0e-15
N_t_cm3: 1.0e12
E_t_eV_above_vb: 0.10
distribution: single

- name: SCAPS_ETL
role: ETL
thickness_nm: 25.0
E_g_eV: 1.90
chi_eV: 4.10
eps_r: 4.2
mu_n_cm2: 1.0e-2
mu_p_cm2: 1.0e-5
N_C_cm3: 8.0e19
N_V_cm3: 8.0e19
N_D_cm3: 1.0e18
N_A_cm3: 0.0
v_th_cm_s: 1.0e7
optical_material: C60

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Preset does not reproduce benchmark optics

When a caller selects scaps_pvk_xy outside the benchmark driver, when callers run the packaged preset through the normal CLI or workstation, its spiro_OMeTAD, MAPbI3, and C60 optical materials remain in effect, and the packaged spectrum is used. Only scaps_native_pvk_xy.py replaces those materials and the spectrum with the native SCAPS tables, so ordinary runs of the preset do not reproduce the benchmark’s optical conditions or its reported metrics.

Make the native optical resources available through normal preset resolution, or clearly separate and label the benchmark-only optical setup so selecting the preset does not imply benchmark parity.

Also at scripts/benchmarks/scaps_native_pvk_xy.py:109-111.

Prompt for AI agents
In `src/solarlab/materials/data/presets/scaps_pvk_xy.yaml` at lines 49-108:

**Preset does not reproduce benchmark optics**

When a caller selects `scaps_pvk_xy` outside the benchmark driver, when callers run the packaged preset through the normal CLI or workstation, its `spiro_OMeTAD`, `MAPbI3`, and `C60` optical materials remain in effect, and the packaged spectrum is used. Only `scaps_native_pvk_xy.py` replaces those materials and the spectrum with the native SCAPS tables, so ordinary runs of the preset do not reproduce the benchmark’s optical conditions or its reported metrics.

Make the native optical resources available through normal preset resolution, or clearly separate and label the benchmark-only optical setup so selecting the preset does not imply benchmark parity.

Also at `scripts/benchmarks/scaps_native_pvk_xy.py:109-111`.

Comment on lines +360 to +361
parser.add_argument("--workers", type=int, default=4)
parser.add_argument("--max-cases", type=int, default=None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Low · Invalid CLI limits fail unclearly

When the caller supplies --workers <= 0 or --max-cases < 0, when --workers is zero or negative, ProcessPoolExecutor raises an uncaught ValueError; a negative --max-cases silently uses Python’s negative slice and runs an unintended subset. Callers get a traceback or misleading benchmark output instead of a clear argument error.

Validate the limits immediately after parsing and report invalid values through parser.error.

Also at scripts/benchmarks/scaps_native_pvk_xy.py:362.

Prompt for AI agents
In `scripts/benchmarks/scaps_native_pvk_xy.py` at lines 360-361:

**Invalid CLI limits fail unclearly**

When the caller supplies `--workers <= 0` or `--max-cases < 0`, when `--workers` is zero or negative, `ProcessPoolExecutor` raises an uncaught `ValueError`; a negative `--max-cases` silently uses Python’s negative slice and runs an unintended subset. Callers get a traceback or misleading benchmark output instead of a clear argument error.

Validate the limits immediately after parsing and report invalid values through `parser.error`.

Also at `scripts/benchmarks/scaps_native_pvk_xy.py:362`.

1.24,
"Cliff & spike trend aligned\nacross [−1.0, +0.5] eV",
1.20,
"Native zero-fit parity\nMed |Δ$V_{\\mathrm{oc}}$| = 0.53 mV",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Benchmark accuracy results conflict

When a reader compares the generated validation figure with the README benchmark summary, the figure reports median |ΔVoc| = 0.53 mV while the README reports 0.60 mV across the same 248 numeric cases, so readers see inconsistent benchmark results.

Use the same median value in the generated figure and README benchmark summary.

Also at README.md:230.

Prompt for AI agents
In `scripts/generate_readme_figures.py` at line 738:

**Benchmark accuracy results conflict**

When a reader compares the generated validation figure with the README benchmark summary, the figure reports median `|ΔVoc| = 0.53 mV` while the README reports `0.60 mV` across the same 248 numeric cases, so readers see inconsistent benchmark results.

Use the same median value in the generated figure and README benchmark summary.

Also at `README.md:230`.


out = OUT_DIR / "ArchitectureFlowV2.png"
out = OUT_DIR / "ArchitectureFlow.png"
fig.savefig(out, dpi=DPI, bbox_inches="tight", pad_inches=0.12, facecolor="white")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Low · Regenerated figures lose versioned history

When the README figures are regenerated, generate_architecture_flow and the other four generators write versionless filenames, while the README links to those same paths, so regenerated figures reuse their names instead of preserving a new V<n> edition.

Write each regenerated figure under a new V<n> filename and update the README links to those files.

Also at scripts/generate_readme_figures.py:599, scripts/generate_readme_figures.py:712, scripts/generate_readme_figures.py:809, scripts/generate_readme_figures.py:886, README.md:59, README.md:168, README.md:213, README.md:225, README.md:237.

Prompt for AI agents
In `scripts/generate_readme_figures.py` at line 448:

**Regenerated figures lose versioned history**

When the README figures are regenerated, `generate_architecture_flow` and the other four generators write versionless filenames, while the README links to those same paths, so regenerated figures reuse their names instead of preserving a new `V<n>` edition.

Write each regenerated figure under a new `V<n>` filename and update the README links to those files.

Also at `scripts/generate_readme_figures.py:599`, `scripts/generate_readme_figures.py:712`, `scripts/generate_readme_figures.py:809`, `scripts/generate_readme_figures.py:886`, `README.md:59`, `README.md:168`, `README.md:213`, `README.md:225`, `README.md:237`.

From CLAUDE.md L46:

| Figures the root README embeds | `docs/figures/` | CamelCase, no date; regenerate under a new `V<n>` and update the README link |

@ShaneLogic
ShaneLogic merged commit aa22c91 into main Nov 23, 2026
25 checks passed
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