Add a simple UI for visualizing the plans
This commit is contained in:
parent
b38b176e7f
commit
6327920bf7
@ -8,7 +8,7 @@ indent_size = 4
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.{rs,hs,py}]
|
[*.{rs,hs,py,js}]
|
||||||
max_line_length = 100
|
max_line_length = 100
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
@ -20,3 +20,6 @@ indent_size = 2
|
|||||||
|
|
||||||
[*.{yaml,yml,json}]
|
[*.{yaml,yml,json}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.{css,html}]
|
||||||
|
indent_size = 2
|
||||||
|
|||||||
@ -54,6 +54,9 @@ The shape today is:
|
|||||||
- `tools/exporter/`: Haskell tool that consumes hand-authored `.scenario.json` files in `tools/exporter/examples/` and emits the runner-IR JSON
|
- `tools/exporter/`: Haskell tool that consumes hand-authored `.scenario.json` files in `tools/exporter/examples/` and emits the runner-IR JSON
|
||||||
consumed by `crates/plan-runner`.
|
consumed by `crates/plan-runner`.
|
||||||
See [`tools/exporter/README.md`](tools/exporter/README.md).
|
See [`tools/exporter/README.md`](tools/exporter/README.md).
|
||||||
|
- `tools/plan-viewer/`: static HTML viewer for `plan-runner` fixtures.
|
||||||
|
It evaluates a fixture in the browser and renders the plan DAG, per-node relations, input facts, and oracle comparison.
|
||||||
|
See [`tools/plan-viewer/README.md`](tools/plan-viewer/README.md).
|
||||||
- `external/`: git submodules.
|
- `external/`: git submodules.
|
||||||
`external/geolog` provides the Haskell query planner used by the exporter; `external/geomerge` is the Rust CRDT crate consumed by
|
`external/geolog` provides the Haskell query planner used by the exporter; `external/geomerge` is the Rust CRDT crate consumed by
|
||||||
`storage::adapters::geomerge`.
|
`storage::adapters::geomerge`.
|
||||||
|
|||||||
37
tools/plan-viewer/README.md
Normal file
37
tools/plan-viewer/README.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Plan Viewer
|
||||||
|
|
||||||
|
A static HTML viewer for `plan-runner` fixtures.
|
||||||
|
It renders the plan DAG, the input facts, and the relation computed at every plan node, so a fixture can be inspected without reading raw JSON.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Open [`index.html`](index.html) in a browser, then drop a fixture from `crates/plan-runner/fixtures/` onto the page or pick one with the file input.
|
||||||
|
|
||||||
|
When the repository is served over HTTP, a fixture can also be loaded through a query parameter:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python3 -m http.server 8000
|
||||||
|
# then open:
|
||||||
|
# http://localhost:8000/tools/plan-viewer/index.html?fixture=../../crates/plan-runner/fixtures/two_atom_join.json
|
||||||
|
```
|
||||||
|
|
||||||
|
## What It Shows
|
||||||
|
|
||||||
|
- **Plan DAG**: one box per plan node, laid out left to right by join depth, with `L` and `R` labels on join inputs and the root node marked.
|
||||||
|
Each box shows the node's output columns and row count.
|
||||||
|
- **Selected Node**: a plain-language description of the operator, its output columns, and the full relation computed at that node.
|
||||||
|
Wildcard columns (names starting with an underscore) are dimmed.
|
||||||
|
- **Result Bindings**: the root relation projected to the fixture's `expected_bindings` columns, with a per-row check against the oracle and a list of any expected rows the plan did not produce.
|
||||||
|
- **Input Facts**: one table per relation in the fixture's schema.
|
||||||
|
|
||||||
|
The header badge reports whether the evaluated bindings match the fixture's `expected_bindings` as a multiset, mirroring `plan_runner::verify`.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
The viewer re-implements the scan, semijoin, and natural join semantics of `crates/query-ops` and the execution order of `crates/plan-runner` in JavaScript, for display only.
|
||||||
|
The Rust crates and their tests remain the correctness oracle; if the two ever disagree, the Rust behavior wins and the viewer has a bug.
|
||||||
|
|
||||||
|
Unsupported cases:
|
||||||
|
|
||||||
|
- plan node actions other than `scan` and `join`
|
||||||
|
- fixtures without a `query` and `schema` block
|
||||||
BIN
tools/plan-viewer/index.html
Normal file
BIN
tools/plan-viewer/index.html
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user