Skip to content

feat(playground): explain noncomputational annotations in-app - #232

Closed
bachase wants to merge 1 commit into
bc-cleanup-noncomputational-mvpfrom
bc-playground-noncomp-notice
Closed

feat(playground): explain noncomputational annotations in-app#232
bachase wants to merge 1 commit into
bc-cleanup-noncomputational-mvpfrom
bc-playground-noncomp-notice

Conversation

@bachase

@bachase bachase commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Note

Prototype PR into the bc-cleanup-noncomputational-mvp feature branch — lighter review bar than main.

Pasting a circuit with LOSS or LEVEL_TRANSITION into the playground currently surfaces the raw C++ error, which tells users to "run the circuit through clifft.noncomp.sample" — a dead end in the browser (no noncomp entry in wasm, and no way to define a noncomp.Model from pasted text). This renders playground-appropriate guidance instead.

What changed

  • NoncompNotice — one shared component: "Leakage & loss annotations (LOSS, LEVEL_TRANSITION) aren't supported in the playground. See the leakage & loss guide for the Python API." with the guide linked (external-link idiom matched to the app's existing one).
  • Both surfaces the error reaches (traced, not assumed): the compile path (App.tsx — new scoped banner below the toolbar; general compile errors keep their existing rendering) and the simulate path (HistogramChart.tsx — one more branch beside the existing MemoryLimitExceeded special case; the Simulate button isn't gated on compile success, so a LOSS circuit reaches this path too).
  • Detection: isNoncompAnnotationError in types.ts matches the C++ message on "noncomputational annotation", robust to which gate triggered it. The C++ message itself is untouched — it remains correct guidance on the Python/C++ surfaces.

Notes

  • The guide URL (…/guide/leakage-and-loss/) was verified against mkdocs.yml (site_url + nav) and the live site's directory-URL convention; it 404s today only because the leakage guide exists solely on this feature branch — it resolves once the branch reaches main and docs deploy.
  • No C++/wasm changes; no CMake churn.

Validation

  • npm ci, npx tsc -b, npm run lint — clean (mirrors the CI playground job)
  • npm run build — succeeds; grepped the bundle to confirm copy, URL, and detection string survived bundling
  • pre-commit run --all-files — clean

🤖 Generated with Claude Code

The compile error for LOSS and LEVEL_TRANSITION tells users to run the
circuit through clifft.noncomp.sample, which is not reachable from the
browser. Recognize that error in the playground and render copy that
says the annotations are unsupported there, linking the leakage and
loss guide for the Python API.

Assisted-by: Claude (Sonnet 5) <noreply@anthropic.com>
@bachase

bachase commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Incorporated into #231

@bachase bachase closed this Jul 31, 2026
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