Compare reachability: one hop from where the question arises
TheYuchen
8311ef0
* RunHistory: while exactly one compare checkbox is ticked, a status
chip at the panel top says what completes the gesture ("1 of 2
picked — tick one more run, or A/B a card in Multiverse"); the
first tick used to feed only a tab badge.
* Fidelity card: with >=2 archived runs of the current configuration
the across-runs strip grows a "compare vs previous run" link
(marker compare-vs-previous) setting compareIds to the two latest
run_ids via the new store action setCompareIds — the Evidence
pane's existing length===2 auto-switch takes over.
Restore/replay: transient pulse on the rebuilt canvas
TheYuchen
123b5a8
pendingRestore (History restore/replay and scenario boots — same
bridge) swaps the whole canvas behind the pane the user clicked in;
the silent mutation read as "nothing happened". Every restored node
now pulses one 1.2s accent ring (.restore-pulse, index.css), class
stripped after 1.4s via functional setNodes so mid-window drags
survive and the next restore re-triggers. Global
prefers-reduced-motion rule collapses the animation.
TipIcon: portal the tooltip out of overflow containers
TheYuchen
d3d2c90
The CSS-only bubble clipped inside every overflow ancestor (Evidence
pane scroll body). createPortal to document.body, position:fixed from
the trigger's rect, measured-then-placed, flips above/below by
viewport space, clamps horizontally, closes on scroll/resize.
Hover+focus preserved; sr-only hint keeps the accessible name inside
the trigger (portal bubble is aria-hidden + pointer-events-none).
Export-safe: trigger keeps data-export-strip, bubble lives outside
every exported subtree. No new deps.
The 36 shipped entries predated the provenance rework (no
transformation/distribution/seed fields) yet still validated as
RunResponses, so a hit would render a crippled first run. Worse-and-
better at once: every key was already unreachable — the key hashes
QPY bytes (changed by the qiskit upgrade) and the script's preset
mirror had drifted from the frontend's defaultData (JS `500` vs
Python `500.0`, missing fidelity params).
* run_cache: stamp cache_schema=2 on write, treat unstamped/old
entries as misses (logged once per key); writes scrub the seed
envelope (disk cache is seed-free by design; per-step seed_used
stays as the honest record). 6 new unit tests; lane now 86 green.
* Delete the 36 dead files; regenerate qucad+compvqc x 9 samples (18
entries) from the LIVE Space via the new resumable
scripts/regenerate_precomputed_cache_live.py, which refuses to run
unless local qiskit == live /api/health qiskit (key parity).
Torch-heavy presets (qubound/qshot/full) stay unca…
Inventoried font sizes, label casing, chip styles and number
formatting across the seven views. The system is already largely
convergent; three real drifts fixed, and the convention is now
written down next to the tokens (index.css UI-conventions block):
- 9px floor: the only two sub-9px labels (CompareView "divergence
point", BlockPicker "plugin" suffix) bumped from 8px to 9px.
- Section-label convention: FinalMetrics' uppercase labels were the
one instance missing tracking-wider.
- Compact-line decimals: the fidelity card's across-runs line mixed a
2dp mean with a 1dp range in one sentence — now 1dp like every
other strip/board stat (headline metrics and mono detail lines
stay 2dp; targets stay whole pp).
Deliberately NOT churned (documented instead): tracking-widest on
palette family badges (distinct role), micro-chips in 28px history
rows and tab count badges (px exceptions), CompareView's 2dp Δ (it
sits in a 2dp mono detail line).
Comprehension audit: close the self-explanation gaps
TheYuchen
530ca91
Walked every interactive element (toolbar, Evidence pane, history
rows, multiverse cards, theater, pickers, param editors) asking "does
this explain itself where the user finds it?". Most surfaces already
carry task-language titles/TipIcons; six gaps fixed:
- ×N replicate selector now states the caching consequence (the
deterministic prefix is served from cache after run 1; only
stochastic steps re-run) — previously only the cost chip said so,
and only once N>1 with history present.
- Precision-target selector states that the target is archived with
the run and restored on replay (an early stop reproduces exactly).
- Evidence tabs (Current run / History / Compare) gained one-line
title tooltips; the count badges inherit context from them.
- The two funnels now explain their relationship in both directions:
the fidelity-card funnel (shot batches inside one run) and the
lineage funnel (runs across a replicate group) cross-reference each
other as one motif in two contexts…
Restore the welcome tour, rewritten for the evidence workbench
TheYuchen
afdd2a9
The Wave-P de-product pass deleted the product-era tour along with the
identity chrome. Reviewers see the paper rather than the site, so
onboarding affordances can return — but the old slides narrated a
feature tour of a system that no longer exists. This resurrects the
modal shell (keyboard nav, progress dots, first-visit localStorage
flag, backdrop dismiss) and rewrites all content around the current
narrative in five slides:
1 What this is — pipelines as seeded, archived, replayable
experiments ("evidence, not just output") + schematic SVG.
2 Compose & run — palette → canvas → Run; ribbons as circuit flow,
node faces as delta strip + CI bar.
3 Evidence accumulates — ×N replicates, lineage (hue=configuration,
dot area=shots), the narrowing funnel, precision-target stopping.
4 Compare & explore — Multiverse small multiples, A/B with honest
intervals ("overlap ≠ evidence").
5 Try it — demo archive first moves; "Open Multiverse" button;
?scenario=F0 pointe…
Remove the GMU-branded theme entirely
TheYuchen
ceee520
Double-blind treatment is no longer needed (reviewers see the paper,
not the site), and the branded palette was the last piece of identity
chrome with real maintenance cost: theme.ts gated it behind ANON,
vite.config.ts carried a CSS-stripping generateBundle hook, and every
new visual had to be checked under a third palette.
- theme.ts: ThemeKey is light|dark; gmu entry gone; stored "gmu"
preference migrates to the light default (comment documents it).
- index.css: [data-theme="gmu"] token block deleted.
- vite.config.ts: %THEME_KEYS% is always ["dark"]; the anon
CSS-stripping hook is retired (nothing left to strip). The rest of
the VITE_ANON machinery (titles, manifest) is unchanged.
- Stray "three themes" comments updated.
Residue grep: only the migration comment mentions the old key.
- EvidenceTheater stop annotation: a late stop (batch 7 of 8) ran the
~330px label past the 1000px viewBox; it now flips to the left of
the stop line only when the right side would clip. Threshold keeps
the verified F0 teaser label on its right side, bit-identical.
- Target corridor: yDomain clamps to [0,1], so with a point near the
scale ends a corridor value can fall outside the domain and y()
extrapolated the dashed line into the panel title. Out-of-domain
lines are skipped and the label y is clamped into the plot band.
- Manual Run now clears a still-pending scenario auto-run (the
consumer only defers on `running`, so it used to fire a second
unasked run after the manual one finished).
- Theater's pooled prior-evidence band refreshes on historyVersion
(deleting archived runs while the theater is open left it stale);
the created_at < startedAt cutoff makes the refetch idempotent
during replicate loops.
- Multiverse card stats row wraps at the 240px card minimum…
- RunHistory rows: fixed-width chips (time, hash, demo, F=, stop,
seed, 3 buttons) summed past a narrow Evidence pane's width and the
overflow-x-hidden aside silently clipped the restore/replay/delete
buttons. The middle metadata now lives in a min-w-0 overflow-hidden
group (name truncates first, then chips clip) so actions stay
reachable at any pane width; rows remain strictly single-line, so
the gutter's RUN_H dot arithmetic is untouched.
- Deleting a run that is selected for comparison now deselects it;
CompareView additionally re-resolves on historyVersion and clears
itself when either record is gone (it used to keep rendering the
deleted run's data), and a lookup failure no longer leaves a stale
pair.
- CompareView header wraps: the verdict chip pushed the close X out
of narrow panes.
- TopBar z-20 -> z-40: the ThemeSwitcher dropdown lives inside the
header's stacking context, so the Multiverse board (z-20) and the
Evidence Theater (z-30) overlays painted over it where it hangs
below the bar. Mobile drawers (z-40/50, later in DOM) still cover.
- CanvasToast z-30 -> z-40: run errors / replicate notices fire while
the theater (which auto-opens on streaming runs) covers the canvas
and were invisible behind it.
- Canvas toolbar: min-h-12 + flex-wrap (row and action cluster,
min-w-0 so wrapping actually engages). The cluster's md:/lg: label
breakpoints key on the viewport while the row lives in a resizable
column; at 1280-1440px windows with default panes the row
overflowed and clipped the Run button. One-line case renders
pixel-identical.
- Copy: last "Results" remnants -> "Evidence" (TopBar drawer button
title/aria, App resizer aria-label).
Filmstrips: Evidence Theater gains a batch-index trace scrubber
(replayed/archived runs only; live path untouched) that renders the
chart AS OF batch k — truncated intervals/envelope, "so far" readouts,
stop annotation only once reached. Exports in a scrubbed state are
bit-exact per (trace, k) and embed trace_position in the provenance;
F0 filmstrip recipe (batch 2 / batch 4 / final) documented with
live-verified widths (±3.06 / ±2.16 / ±1.93pp).
Illustrator-grade true-SVG: new lib/svgPaper.ts holds the pure
presentation-inlining logic (whitelisted attributes resolved via
getComputedStyle to literals — zero var()/currentColor/class/<style>;
concrete font stacks; px normalized; viewBox-derived pt sizing;
standalone XML header) with a plain-node unit test
(scripts/check_svg_paper.test.ts) and a per-export safety audit.
Raster: hybrid PNG at explicit pixel dimensions (never
devicePixelRatio); 2.5x default, 4x via alt-click/long-press on the
camera. Files named <view>_<scenario|runid>[_b…
Evidence Theater: steering becomes the visual protagonist (+F0 teaser)
TheYuchen
f686793
The system's most novel contribution -- anytime evidence steering
(streaming CI narrowing + optional stopping, Wave I) -- was the
smallest element on screen. New EvidenceTheater overlay (auto-opens on
the first step_progress frame, dismissable, localStorage auto-open
pref, toolbar + fidelity-card reopen affordances): one big SVG funnel
per sampled node -- per-batch Wilson CIs on a linear shots axis with
convergence envelope, first-interval-anchored auto-zoom, dashed target
corridor + early-stop annotation with unspent-shots region, client-
timed cost row (caveat commented) with server-total fallback, and a
context strip (config hue chip, live root-seed via new runStream
onMeta hook, pooled prior-evidence archive band). Store retains per-
node stamped traces until the next run so the theater outlives the
step; true-SVG figure export with embedded provenance.
Scenario F0 (the teaser): bell_state on FakeFez, 4096 shots, sampled
fidelity, target +/-2pp, pinned seed 2026 (probed live: all …
M1 scenarios.ts QUCAD_GRAPH is now a literal copy of bundled demo
record 5c2a6a71a7a4's graph (ids n1..n5, sampled fidelity, same
params/positions) instead of an s1..s5/statevector rebuild —
F1/F5 runs now group with the demo cards (same config_hash) and
pinned seed 336157917 replays the archived numbers bit-exactly.
M2 Optional-stopping honesty in three places: limitation block at
the stopping rule (qlib/qiskit_utils.py — width-based
data-dependent stopping perturbs exact nominal coverage of the
final fixed-n interval; confidence sequences are the rigorous
alternative), one sentence in the Wave I doc section, and a
clause in the precision-target tooltip.
M3 Anon builds scrub the branded theme completely: generateBundle
strips the [data-theme=gmu] CSS block, and theme.ts gates the
stored-preference fallback behind !ANON so the key literal is
dead-code-eliminated from VITE_ANON JS (runtime ?anon=1 behavior
unchanged). Anon dist grep…
Audit C1: pinned step-cache identity includes node ids
TheYuchen
d5ab6bd
Per-node seeds derive from sha256(root_seed:node_id), but the step
cache's _prefix_hash keyed only {type, data} per node — so two
id-renamed, structurally identical graphs under the same pinned seed
shared cache entries while owing DIFFERENT draws (live-demonstrated
cross-graph poisoning: run B was served run A's seeded numbers).
Fix: in the salted (seed-pinned) regime the per-node hash payload now
includes the node id — node ids are part of seed identity. The fresh
(unsalted) regime stays id-free on purpose: fresh runs never cache
stochastic steps, so id-blind prefix sharing is sound there and the
precomputed/prewarm namespace is untouched.
Regression tests: pinned hash is id-sensitive, fresh hash stays
id-blind, plus an executor-level same-seed a1-vs-b1 test asserting the
renamed graph executes with its OWN derived seed (no poisoned cache
hit) and then replays bit-exactly from its own entry. Lane: 80 green.
* workflow_service: a step-cache hit now re-stamps the CURRENT
node's id onto the served StepResult. The prefix hash ignores node
ids, so a cached step written by a graph with different ids was
served verbatim (live-reproduced: an s1..s5 scenario run poisoned
a n1..n5 archive replay, which came back with node_ids s1..s3 the
frontend cannot map). NOTE this fix only repairs the id, not the
deeper pinned-cache identity hole — per-node seeds derive from
node ids but the pinned cache key does not include them, so
structurally-identical graphs with different ids can still serve
each other's draws under the same root seed (see audit report).
* FlowCanvas: ribbon-legend localStorage key renamed quaim-* ->
quda.* ("quaim" matched the identifying Space slug and shipped in
the VITE_ANON bundle, contradicting the doc's anon-audit claim).
* scenarios/doc: F3's expected stop corrected to the value the live
API actually produces (2,560 of 4096 shots; 512-shot batch
granulari…
Wave J: uncertainty-in-provenance (evidence-mass lineage, pooled CIs)
TheYuchen
75184f5
Provenance views stop pretending states are deterministic — lineage
nodes ARE distributions, so the timeline now shows how certainty
accumulated over the session. Minimal honest version, one task per
mark:
* evidence mass (marker `evidence-mass`): lineage dot AREA propto
sqrt(executed shots), radius 3-7px against a fixed 2048-shot
reference; early-stopped runs are visibly lighter. Ring / slash /
edges / hover target track the radius; tooltip gains "N shots of
evidence".
* replicate-band certainty funnel: pooled Wilson CI half-width at
each row (counts summed oldest->newest; valid within a config
group: same underlying p), mirrored polylines around the lane
spine, narrowing upward ~1/sqrt(N) — Wave I's funnel motif, second
context. Tooltip: "pooled +/-X.Xpp after n runs / N shots".
* lib/stats.ts (new): wilson95 ported from
app/services/stats.py::wilson_interval with unit-anchor comments;
runEvidence / poolEvidence helpers.
* Multiverse cards: "pooled mu x.x% +/-y.y…
Fire-and-repoll against the live Space: the first request warms the
memoized noise model server-side (client times out by design), the
re-request hits the pinned step cache instantly. All 17 records now
carry per-batch traces; every trace's last frame equals the
distribution totals; the same-seed replay pair (records 2/16) is
bit-identical. run_ids / created_at / lineage preserved verbatim.
Wave P: correct F3 expected stop point (verified against live API)
TheYuchen
38c04fd
Wave P: paper-first reorientation
TheYuchen
79cd0aa
De-product: remove WelcomeTour(+slides), AuthButton/session UI,
Support(NSF)/Papers/Developers popovers, Lab link, UploadPluginModal
trigger; plugin protocol stays live via API. Neutral index.html
title/meta + PWA manifest. Header = name/tagline/env chip/live
toggle/theme.
Anonymous mode (double-blind): lib/anon.ts. VITE_ANON=1 build folds
identifying strings out of the bundle (EvidenceQ codename, no paper
bibtex, no GMU theme, vite plugin rewrites index.html+manifest);
?anon=1 runtime fallback hides the same surfaces on normal builds.
Audit: zero user-visible identifying strings in the anon dist.
Figure export with embedded provenance: lib/figureExport.ts + camera
buttons on canvas toolbar / Multiverse header / Evidence header.
True-SVG for svg targets, foreignObject-SVG + 2.5x PNG for HTML
composites; paper transform (white bg, fonts x1.25, chrome stripped);
SVG <metadata> + .provenance.json carry app version, export time,
run_ids/root_seeds/config_hashes of every visible run and t…
Wave P spec: paper-first reorientation directive
TheYuchen
67b247f
Wave I: re-record bell demo records under batched draw scheme
TheYuchen
a892a99
The Wave I per-batch seed schedule makes pre-Wave-I sampled records
non-replayable (a single 2048-shot draw != 8 seeded 256-shot draws).
Re-recorded all 14 bell_state demo records (512 + 2048, incl. the
same-seed replay pair) against the live API via the resumable script;
each now carries the per-batch trace and replays bit-exact. The 3
vqc_2q_small (QuCAD) records still carry old-scheme numbers — the
loader degrades gracefully (omits the funnel, keeps the CI bar);
finish them with scripts/rerecord_demo_archive.py on an idle Space.
Doc: migration status + live regression numbers recorded.
Backend: sampled fidelity always runs as B=min(8,max(2,shots//128))
batches; batch i seeded sha256(f"{node_seed}:batch:{i}") so replays
are bit-exact regardless of any run's stopping point. Streaming SSE
interleaves {"step_progress": {node_id, batch_i, n_batches,
shots_done, successes, point, ci95}} frames (worker thread + queue in
the executor; eager path unaffected). RunRequest.precision_target
(CI half-width, (0,0.5]) = server-honoured optional stopping, min 2
batches; distribution records shots executed vs requested,
stopped_early, and the full per-batch trace. qlib duplicates the
Wilson fn (no app import from qlib); twins pinned equal by test.
Frontend: toolbar precision-target select (off/±5/±2/±1pp); live
narrowing CI band + shot counter on node faces from streamed frames;
evidence-funnel in the fidelity card (one line per batch, opacity
ramp, target ticks at point±target, early-stop annotation); RunRecord
persists precision_target + stopped_early; restore/replay writes the
tar…
Roadmap: waves I-K after full-system novelty review
First-contact evidence: bundled real demo archive, multiverse landing
TheYuchen
8829e2f
frontend/src/data/demoArchive.json: 17 genuine RunResponses recorded
against the live deployed API (post noise-model-memoization build),
79 KB:
* Config A — bell_state | fake_backend(FakeFez, 512 shots) ->
fidelity(sampled) -> output; 8 seeded replicates, fidelities
0.457-0.508 (real shot noise, Wilson CI width ~0.086).
* Config B — same pipeline at 2048 shots; 5 replicates, CI width
~0.043 -> the A/B interval-width story in compare is real.
* Config C — vqc_2q_small | fake_backend -> qucad -> fidelity
(sampled) -> output; 3 runs, ~0.967, QuCAD keeps 1 of 2 params
(P-2 delta glyph + gate-level diff payloads present).
* One replay pair: Config A run f0cb7403bbae re-run under its own
pinned seed 815033775 -> distinct run_id, bit-identical fidelity,
forkedFrom lineage edge + pinned ring in the timeline.
All runs are seed-pinned (client-drawn random seeds) because that is
what makes each record replayable bit-exact from the archive — and
what made coll…
Backend: AerSimulator.from_backend / NoiseModel.from_backend rebuilt
the full 100+ qubit device noise model on every sampled-fidelity and
QuCAD step (~40-90 s of GIL-bound Python per fresh run — the dominant
cost of every uncached run on the Space). Fake* snapshots are frozen,
so the derived model is memoized by backend name (live IBM backends
never cached). qlib/qiskit_utils.aer_simulator_for / noise_model_for.
Frontend: plumbing for a bundled first-visit evidence archive —
RunRecord.demo flag, lib/demoArchive.ts (ensureDemoArchive imports
data/demoArchive.json via buildRunRecord on first visit only, decided
flag quda-demo-decided, clearDemoRuns), DemoArchiveBanner on the
Multiverse board + History tab, per-row demo chip, multiverse landing
for first visits, welcome-slide tagline reframed to the evidence
story. Archive JSON itself ships in the next commit (placeholder []).
Seed coverage for QuBound/Qshot + cost estimates from run history
TheYuchen
91b2cd9
Closes the two remaining claim-integrity gaps for "every run is
exactly replayable" over "stochastic, costly experiments":
Seeds. QuBound trains its LSTM on BOTH ok paths (live IBM history and
the cached 14-day pickle) — there is no precomputed-only branch in the
handler — so both now seed the global RNGs (_seed_stochastic_libs:
random + numpy + lazily-imported, try/except-guarded torch) and thread
node_seed into qlib (Aer seed_simulator + Sabre seed_transpiler in
get_labels_fromNoise); results carry nondeterministic=True +
seed_used. Qshot's pilot seed was 99991 + hash(str(base)) — str hashes
are PYTHONHASHSEED-salted, i.e. "fixed" only until the next server
restart. pilot_seed is now threaded predict → recommend_shots →
compute_pilot_pf, making the recommendation reproducible across
processes given the seed. Executor cache logic untouched: fresh runs
draw fresh node seeds (honest new draw, cache-bypassed), pinned runs
re-derive the same seeds (cacheable in the seed-salted namespace)…
Multiverse board: configurations as small-multiple evidence
TheYuchen
4bf1a9d
The set of configurations the analyst has tried becomes a first-class
workspace. A Compose|Multiverse segmented toggle in the canvas toolbar
flips the center column to a MultiverseBoard: one card per config_hash
group, each with a topological pipeline schematic (family-colored 8px
squares, warn dots on stages whose params differ from the baseline),
the outcome distribution on a shared 0-1 scale (group hue, mean tick,
latest emphasized), Δmean vs the most-tried (baseline) configuration
in pp with an "(n small)" honesty flag under 3 replicates, and
Open/A-B actions wired into the existing restore + compare bridges.
The board overlays the canvas instead of replacing it so React Flow
graph state and the pendingRestore watcher survive mode flips.
hashHue/hueCss move to lib/hues.ts, shared by RunHistory and the
board so a configuration keeps one color everywhere. Tour welcome
slide gains one sentence pointing at the mode.
Circuit ribbon canvas: the pipeline itself becomes the visualization
TheYuchen
324791f
Post-run, circuit-flow edges render as tapered ribbons (custom React
Flow edge type): band thickness = clamp(1.5·sqrt(gates), 3, 18)px at
each end, sampled-bezier polygon so the taper shows each downstream
transformation; downstream half tinted ok/green when the step shrank
the circuit, warn/amber when it grew. Backend side-channel edges stay
thin/dashed (they carry calibration, not a circuit); pre-run edges
unchanged. Node faces: delta-strip glyph now anchors the full tile
width (stretch prop, preserveAspectRatio=none keeps the encoding
invariant) and sampled-fidelity steps get a 3px CI bar (interval band
+ point tick, 0-1 scale) on the tile. Dismissible bottom-left legend
chip (localStorage) keys ribbon width / taper tint / delta strip.
Information architecture: the results pane is now the Evidence pane
with three tabs — Current run (step cards + final metrics + hints),
History (lineage view, always expanded, no own collapse toggle when
embedded), Compare (instruction pointing at History's checkboxes
until two runs are picked). Badges: History = archive size via a new
countRuns() IndexedDB count (refreshed on historyVersion), Compare =
selection count. Auto-switch: starting a run -> Current; ticking the
2nd compare checkbox -> Compare. flex-wrap tab bar so the pane still
works inside the mobile drawer; collapsed strip + drawer title renamed
to Evidence.
Comparison: consecutive leading step rows that are identical on both
sides (same node kind, no structural param diff for that kind, equal
transformation-signature deltas) fold into one expandable "shared
prefix - N steps" <details> row; the first divergent row carries an
accent left border + "divergence point" label. Rationale in code: the
analytical question is where…
Gate-level circuit diff: qubit-lane LCS alignment per step
TheYuchen
94e47b0
Backend:
- New services/circuit_diff.py: lane_sequences() tokenizes each
qubit's gate sequence (name + 3dp param fingerprint; unbound
params keep symbol names; 2q gates on both lanes with c/t role
tags, symmetric ops undecorated; measures kept, barriers skipped)
and diff_lanes() aligns before/after lanes with a standard LCS
diff (kept/removed/added in merged order). Hard cap 12 qubits /
600 combined ops -> truncated marker.
- Executor: copy the circuit BEFORE dispatch (handlers may mutate
ctx["circuit"] in place -- the historical QuBound measure_all bug
shape), stamp gate_diff into StepResult.transformation when the
step changed the circuit. Best-effort: any diff failure is logged
and omitted, never breaks a run.
- tests/test_gate_diff.py: 14 torch-free unit tests incl. an
executor wiring test that mutates in place.
Frontend:
- New CircuitDiff.tsx inside SignatureCard, collapsed <details>
("Gate-level diff / N removed / M added"): one mono-labelled row
per qu…
Signature glyph: designed delta-strip encoding replaces text chips
TheYuchen
4288025
The transformation signature is now a real glyph, not typography:
a fixed-order strip of horizontal diverging bars (D, G, P, Q top to
bottom) around a center zero axis. Bar length is relative change
(delta/before, capped at +/-100%) so a depth halving reads the same
size on any circuit; decreases extend left in the ok tone (every
optimizer here aims to shrink), increases right in warn; qubit
changes are neutral accent either way (width is a property, not a
cost). Zero channels render as faint ticks so the 4-row silhouette
is constant - glyph recognition depends on the constant frame.
New export SignatureGlyph({t, size}) draws the strip from a raw
payload at two densities: tile (46x14, tooltip carries numbers) on
canvas nodes and in the CompareView step table (replacing sigText
cells; sigText survives as tooltip), and card (180x56, channel
letters + printed deltas) in the results pane, beside the exact
before->after grid. Per-op chips become a |delta|-sorted diverging
bar list. All fil…
Provenance lineage view: timeline becomes a real visualization
TheYuchen
cfb84a4
Replace the run-history list body with a vertical lineage graph
(newest at top). An SVG gutter, absolutely positioned inside the
scroll container so it scrolls with the rows, encodes:
- node hue = config_hash (stable hash->hue pastel; same configuration
is the same color everywhere), constant node size by design;
- ring around the dot = pinned/replayed seed_mode, bare dot = fresh;
- hollow node + red slash = errored run;
- curved bezier edges = forked_from descent, drawn in the child's hue
so a configuration's origin can be traced by its own color;
- rounded band + spine = contiguous replicate block of one config;
- per-block distribution strip (>=2 replicates with headline values):
dots on a 0-1 scale for every value archived up to that block, so
distribution buildup is visible while scrolling down the past;
bright dots = this block, faint = older, tick = mean.
Hovering a row or its dot highlights the full lineage chain
(ancestors via forked_from plus all descendants) by d…
Document evidence-workbench rework state, rationale, and backlog
TheYuchen
8b3dd78
Composition comparison: two archived runs side by side, CIs not scalars
TheYuchen
d105dc7
Phase 3 (minimal viable) of the evidence-workbench rework. Pick any
two runs in the history panel (checkboxes, keep-latest-two) and a
comparison panel renders:
* configuration diff — params matched structurally by (kind,
occurrence) exactly like configHash, so node ids and layout don't
matter; circuit swaps surface as a "circuit" row;
* same-configuration detection — when the config hashes match the
panel says so explicitly ("differences are noise"), because that
changes how any metric gap must be read;
* fidelity compared as intervals — both Wilson CIs on one 0-1 scale
with the Δ in percentage points, and an explicit "intervals
overlap: not evidence" callout when the difference is within
run-to-run noise at these shot counts;
* step-by-step alignment with each side's transformation signature.
Transformation signatures: uniform circuit-delta vocabulary per step
TheYuchen
f956d64
Phase 2 (part 1) of the evidence-workbench rework. The executor now
snapshots the circuit's structure (shape + gate counts by op) before
and after every dispatched node and stamps a uniform transformation
payload onto each successful StepResult: before/after snapshots,
shape delta (qubits/depth/gates/params), per-op count delta, and a
changed flag distinguishing pass-through steps from mutating ones.
Captured centrally — handlers (and user plugins) never build this
themselves, which is what keeps the vocabulary identical across
QuCAD pruning, CompVQC folding, transpiles, and anything a plugin
does. Kind-specific detail stays in each handler's summary.
Frontend renders it at two densities: SignatureTile on canvas nodes
(nonzero delta channels only, e.g. "D-4 G-12 P-12"; decrease=green
since every optimizer in the catalog aims downward, increase=amber,
qubit-width neutral) and SignatureCard in the results pane
(before → after per channel + per-op chips). Pass-through steps say
so expli…
Provenance timeline: run archive, restore/replay/fork, replicates
TheYuchen
f2c03b7
Phase 1 of the evidence-workbench rework. Every completed run is now
archived client-side (IndexedDB — the server stays stateless by
design) as an immutable RunRecord: the graph in share-link
serialization, the full per-step response, and the seed envelope.
Run history panel (results pane): newest-first timeline with a
structural configuration hash chip — runs sharing a chip are
replicates of the same experiment. Actions per entry: restore
(canvas + circuit come back exactly), replay (restore + pin the
recorded root seed, so Run reproduces the exact draw), delete.
Restores thread forked_from lineage into subsequent records.
Replicate execution: a ×1/×5/×10/×20 selector runs the same
configuration N times with fresh seeds, sequentially, archiving each
draw. The fidelity card now renders sampled results as what they are
— a draw, not a number: Wilson 95% CI on a fixed 0-1 scale, the
top-outcome histogram, the consumed seed, and an across-runs strip
that accumulates one dot per archived…
Provenance core: run identity, replayable seeds, distribution payloads
TheYuchen
2efd890
Phase 0 of the evidence-workbench rework. Every run now gets a
server-stamped provenance envelope (run_id, seed_mode, root_seed,
app_version) in both the eager and SSE routes; the SSE stream opens
with a run_meta event. Every run draws a root seed even when the
caller doesn't pin one, so any historical run is replayable later by
sending its recorded seed back.
Per-node seeds derive from sha256(root_seed, node_id) — independent
of execution order and of unrelated graph edits, keeping A/B
comparisons honest. Sampled fidelity accepts the seed
(seed_simulator) and reports a structured distribution payload:
binomial successes/shots, Wilson 95% CI, top-16 outcome histogram.
Cache semantics: seed-pinned runs live in a salted cache namespace
and may cache stochastic steps (reproducible by construction); fresh
runs keep today's namespace and the nondeterministic bypass.
Precomputed disk-cache responses are never served for pinned runs.
19 new unit tests (seed derivation, Wilson edges, salted…
Three concrete refactors that reduce surface area for future bugs and
make the codebase easier to maintain by hand or by LLM.
1. backend/app/services/workflow_service.py — run_pipeline and
run_pipeline_stream used to be two 100+ line copies of the same
dispatch loop. Extract a single _execute_pipeline generator and
make both functions thin wrappers (one collects into a list, the
other yields). Per-node dispatch (input / built-in / plugin /
skipped) and the post-step circuit_shape stamping are factored
into _dispatch_one_node. Plugin hydration becomes a named helper
instead of an inline block duplicated on both paths.
Also pulled out _clamp_shots and _set_backend_ctx so the two
backend handlers share their shots-clamping and ctx-writing
patterns; _cache_put's prefix_types argument becomes required
(all call sites pass it; the dead 'None means skip sidecar'
branch is gone); the run_cache.qpy_dump_bytes import moves to
the top of the file with the …
Code quality cleanup + first unit-test seed
Yuchen Yuan
6962cb3
Post-audit polish on the bug-fix wave from the last 9 commits:
* Hoist function-level constants to module top so they're
discoverable and reusable: _FAKE_BACKENDS_AVAILABLE,
_FIDELITY_METHODS, _FIDELITY_UNBOUND_POLICIES,
_COMPVQC_MAX_QP_VARS, _COMPVQC_ROTATION_GATES.
* Move 'import re' from inside _format_exception_for_user to the
file's top-level imports.
* Standardise validation error phrasing on 'Choose one of: ...'
(was a mix of 'Allowed values:' and 'Choose one of:').
* Add the same name-validation rigour to _handle_ibm_backend that
_handle_fake_backend has — refuse empty / non-string names with
a clear message, and surface IBM's resolution failure through
_format_exception_for_user instead of letting it bubble as a 500.
* Drop the now-unused '_qpy_bytes' alias from run_cache.py; the
one remaining call site uses the canonical name directly.
* Drop the trivial _is_known_fake_backend wrapper; inline the
membership test at the one …
Invalidate step cache when a plugin is (re-)installed
Yuchen Yuan
0894ed2
If a user re-uploads a plugin with the same kind + params, every
in-memory step-cache entry whose prefix covered that kind would
otherwise stay valid — the next run hit-served a result computed
by the OLD plugin code. Confirmed by code review: install_plugin_zip
overwrote the on-disk handler but never touched _step_cache.
Fix is a sidecar map of prefix_key → set of node types covered by
that prefix. _cache_put populates it; install_plugin_zip calls a
new invalidate_step_cache_for_node_type(kind) helper to evict any
entry that includes the affected kind. LRU eviction was updated
to drop both the cache entry and the sidecar entry in sync.
Unit-tested locally (4 scenarios: plugin invalidate, builtin
invalidate, no-match, LRU sync) — all green.
Surface graph-cycle errors as 422 instead of 500
Yuchen Yuan
fa31bfd
A8 degenerate-graph probing: a cyclic node graph (A→B→A) made
topological_order raise ValueError, which propagated as an
HTTP 500. The user saw 'Internal Server Error' with no diagnosis.
Catch ValueError in both /workflow/run and /workflow/run-stream
and return 422 with the actual cycle/malformed-graph message.
For the stream route, pre-flight the topological sort BEFORE
opening the stream — otherwise the error would happen mid-stream
with an empty SSE response and no status code surface.
Other A8 cases (empty graph, output-only, two inputs, disconnected
nodes) all returned reasonable results without crashes.
A4 fuzzing found three silent-coerce UX cracks:
* backend_name='FakeBollywood' silently fell back to FakeFez
* backend_name='' (empty) silently fell back to FakeFez
* method='banana' on Fidelity silently picked statevector
In all three the run reported ok and produced a number — but the
number was for inputs the user didn't ask for. That's worse than
erroring: it pretends to have done what was requested.
Replace the silent coerce with explicit validation. Allowed values
are enumerated in the error message so the user knows what to type.
Also surface the same hardening on unbound_param_policy (same enum
trap pattern).
Stop the chain when a handler returns status='error'
Yuchen Yuan
102bda8
Handlers signal failure two ways: by raising (caught + converted to
status='error' in the loop) or by returning a StepResult with
status='error' directly (e.g. QuCAD's 'needs a backend upstream').
Only the raise path was breaking the loop. A direct-return error
let downstream steps execute on whatever ctx['circuit'] the failed
upstream had left alone, silently producing misleading metrics
(e.g. Fidelity reporting the input circuit's fidelity rather than
the algorithm-transformed one).
Live repro before fix: efficient_su2_4q → QuCAD (no backend) →
Fidelity → Output ran all four steps; Fidelity returned the
input-circuit fidelity even though the chain logically failed.
Now: status='error' is honoured in both run_pipeline and
run_pipeline_stream the same way as an exception. status='skipped'
(e.g. CompVQC scale-guard) still continues — ctx is still valid.
QuBound's get_labels_fromNoise called qc.measure_all() in place to
attach measurements for the Aer shots that train the LSTM. The
comment said 'caller doesn't reuse qc after this point' — but the
pipeline runner does: ctx['circuit'] points to the same object, so
the measurement register leaked into every downstream step.
Reproduction on the live server (ry_chain_6q → QuCAD → QuBound →
Qshot → Fidelity → Output): Qshot crashed with
'ValueError: invalid literal for int() with base 2: "110100…"'
because the counts string suddenly had a 'classical_register meas'
delimiter splitting it.
Two-layer fix:
1. qbound.get_labels_fromNoise now copies qc before measure_all.
2. _handle_qubound also copies ctx['circuit'] defensively when
num_parameters == 0 (when >0, assign_parameters already
returns a fresh circuit). Belt + suspenders so any future
in-place mutation deeper inside QuBound still can't leak.
Audited sampledFidelityEstimator and qshot recommender — both
already copy…
CompVQC scale-guard: count actual rotation instances, not unique Params