feat(playground): explain noncomputational annotations in-app - #232
Closed
bachase wants to merge 1 commit into
Closed
feat(playground): explain noncomputational annotations in-app#232bachase wants to merge 1 commit into
bachase wants to merge 1 commit into
Conversation
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>
Contributor
Author
|
Incorporated into #231 |
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.
Note
Prototype PR into the
bc-cleanup-noncomputational-mvpfeature branch — lighter review bar than main.Pasting a circuit with
LOSSorLEVEL_TRANSITIONinto 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 anoncomp.Modelfrom 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).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 existingMemoryLimitExceededspecial case; the Simulate button isn't gated on compile success, so a LOSS circuit reaches this path too).isNoncompAnnotationErrorintypes.tsmatches 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
…/guide/leakage-and-loss/) was verified againstmkdocs.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.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 bundlingpre-commit run --all-files— clean🤖 Generated with Claude Code