Takes an EDGE algorithm specification and produces a verified, explorable page: step through the cascade one Einsum at a time and watch each one execute over its iteration space.
The page is built by executing the specification with edge-core-ir's evaluator, which is the source of truth for EDGE semantics. The workbench records what that evaluator computed and the page renders it; nothing is evaluated a second time, in the browser or anywhere else.
Needs Python 3.10+, and node for the headless page checks only.
# edge-core-ir, beside this repo, on the branch the workbench runs on
git clone -b fixes_for_edge_workbench https://github.com/edge-einsums/edge-core-ir.git
git clone <this repo> edge-workbench
cd edge-workbench
pip install -e '.[oracles,dev]' # scipy + networkx (verifiers), pytest
npm install # jsdom, for the headless page checks
Use the fixes_for_edge_workbench branch of edge-core-ir (known good:
c8bcbdd), not main. It adds what the examples need and upstream does not
have yet: a reduce inside parentheses, a reduce over an empty fiber writing
nothing, case statements, conditional cascades and inner cascades (issues 2,
7, 8, 9 and 10 in docs/issues-for-edge-core-ir.md).
Everything else the page needs (macro expansion, select-any, the record of
each Populate round) is built here, around the evaluator
(docs/evaluator-needs.md).
They go upstream one pull request per issue; until then, on main most
examples fail. The workbench finds edge-core-ir via EDGE_IR_REPO, then a
checkout beside this repo, then ~/Projects/edge-core-ir.
python3 -m edge_workbench check examples/maximum-flow # writes examples/maximum-flow/index.html
npm test # domain views, every example page, pytest
An algorithm becomes a published page in six steps. Each step names who does it; only the parts marked you need a person.
-
Draft (agent, with you). In Claude Code in this repository, ask for an EDGE tutorial and give one of: an algorithm's name, pseudocode, a program, or an existing tutorial (e.g.
edge-algorithms/_algorithms/<name>.md). Thewrite-edge-tutorialskill (.claude/skills/write-edge-tutorial/) writes the tutorial.md(with itsranks:block and meaning lines) andeinsum.edgeintoexamples/<slug>/, asking whenever something is unclear. You approve at two checkpoints: (A) the pseudocode, worked example and its expected answer; (B) the cascade. -
Verifier (you choose). The skill offers the verifier kinds (
definition,library,certificate,different-algorithm,user-reference); you pick one. It draftsverifier.pyonly for a library check or a wrapper around your own code, or if you ask it to. -
Check (agent):
python3 -m edge_workbench check examples/<slug>Every stage lists all its problems, then stops. The builder and tutorial-data steps write a prompt; the agent answers it in the same session (or you paste it into a chat) and the reply is checked like anything else. Anything about the cascade, the example or the answer comes back to you with evidence. A verifier that has never been approved does not stop the run:
checkcarries on and ends with… approval. -
Approve (you, checkpoint C), once, when
checkasks. Either:- in Claude Code: the agent shows you the whole
verifier.py, its sha and the published answer, then runsapprove-verifier examples/<slug> --confirm "<METHOD>" --sha <sha>..claude/settings.jsonmakes that command always ask you first: clicking allow is your approval. The same settings forbid the agent to writeverifier.lockor the approvals file itself. Ifverifier.pychanged after you were shown it, the command refuses. - in your own terminal:
python3 -m edge_workbench approve-verifier examples/<slug>, typing the METHOD when asked.
This pins
verifier.pyand the tutorial's published answer together inverifier.lock(which records how it was approved). Commit both, runcheckagain, andindex.htmlis written. A verifier or answer that changes after approval stopscheckuntil you approve again. - in Claude Code: the agent shows you the whole
-
Look: open
examples/<slug>/index.html. -
Publish (agent or you):
python3 -m edge_workbench publish examples/<slug>Runs
checkagain and refuses unless it passes, copies the page toedge-algorithms/assets/viz/<slug>/(or--site <dir>), and adds theviz:link to the site's tutorial.--with-tutorialalso replaces the site's tutorial with this one. Nothing is committed.
Without an agent: write the three files yourself (tutorial .md,
einsum.edge, verifier.py) and run steps 3-6, pasting the two prompts
into a chat. AUTHORING.md is the step-by-step guide.
Other commands: python3 -m edge_workbench verify-instance <dir> <k> reruns
one random instance of the answer check.
Two run before the page is written, and there is no flag to skip them.
| gate | question |
|---|---|
| coverage | did every Einsum the author wrote actually execute? |
| answer | is what the run produced right? |
Coverage is the one that replaced comparing against a recording. Its failure mode is silent: an Einsum that never runs produces no wrong value and raises nothing, it just leaves a page whose step list looks complete. It works off the driver's per-IR-node tally rather than the emitted steps, because the two differ on purpose — initialization runs four Einsums and emits one step. A case statement is one Einsum whose arms are tallied separately: everything outside an arm must run on the worked example, and each arm (of a case statement or a conditional cascade) on the worked example or on one of the verifier's random instances.
The answer check is the author's verifier.py, because only the algorithm
knows what right means; the tool runs it on the worked example, the published
answer and 12 random instances. A person approves each verifier with
python3 -m edge_workbench approve-verifier <dir> (AUTHORING.md), and check
refuses one that has changed since.
check also validates the program against the IR (Layer 1 and Layer 2) and
against einsum.edge. npm run gates runs the test suite; the tests that need
an edge-core-ir checkout or
generated example files skip without them.
edge_workbench/ the tool. Contains no algorithm.
author.py `check`: every stage, in order
driver/ run.py: runs edge-core-ir's evaluator and records the trace
render/ build_page.py, annotate.py, display.js (glyphs only; no evaluation)
verifier.py, approval.py the verifier contract and its approval
rank_kinds.py, domain_shape.py which picture a program gets
spec_surface.py reads einsum.edge (labels, macros, constants)
publish.py `publish`: copies a passing page to the site
examples/<alg>/ tutorial .md, einsum.edge, verifier.py (+ verifier.lock);
`check` writes workbench/ and index.html beside them
tests/ generic gates
.claude/skills/write-edge-tutorial/ the agent's skill (SKILL.md, rules.md)
docs/ DESIGN.md (decisions, build plan),
issues-for-edge-core-ir.md (language questions only),
evaluator-needs.md (what the page needs, built here),
tutorial-notes/<alg>.md (questions for one tutorial)
Adding an algorithm is adding a directory with those three files. The tool does not know what any algorithm computes.
A populate names a choice function the IR does not define. Some of those choices are genuinely free and some are the algorithm, and mapping a free one to a fixed rule would make the spec claim something it does not.
Ranking operators (select-min-val, select-max-val) are part of the
algorithm: the better value wins, ties go to the lower coordinate, and the
result does not depend on the schedule. Any other populate name is a free
choice: max-flow's pick-admissible-edge says ANY admissible edge, so it runs
as seeded select-any (the first arrival wins). The page shows the
sequential schedule; the answer check also runs every free choice under
shuffled schedules and requires the same answer from each. An unknown name
stops the cascade rather than being guessed at.
Iis hard-coded as the generational rank (undecided for SpMV).- Long runs (DOBFS, set-cover) show every step; choosing which to show is not built yet.
- set-cover's E02 writes an operation with no merge; giving it the paper's default (pass-through) is not settled.
- One test fails:
tests/test_robustness.py::test_a_value_equal_to_empty_is_reported. - No CI.