Skip to content

refactor(view,queryplan): read the lowered graphs by id - #2335

Merged
HuiJun merged 16 commits into
developfrom
feat/ir-view-queryplan-off-tree
Nov 18, 2026
Merged

HuiJun merged 16 commits into
developfrom
feat/ir-view-queryplan-off-tree

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Part of the "consumers off the tree" step of the execution-IR migration (docs/internals/execution-ir-design.md): the behaviour views, the debug locators and the query compiler read the lowered graphs by id and through lower-side records, so that the later step can delete the tree-typed fields of the graphs without touching them.

Stacked on #2264, which is stacked on #2257. Merge order: #2257 → #2264 → this; it retargets to develop as they merge.

  • internal/ir/view: behavior.go, behavior_forms.go and locate.go walk the action and state graphs through their id-addressed accessors (program.StateID, program.RegionID, program.VertexRef, lower.FlowNode) and take text from an Extent rather than from a tree node. The state locator answers by id as well as by declaration, and gives no answer for a graph-only state that owns a parallel state's region.
  • internal/ir/lower: graph_declared.go hands a reader that attaches to declarations the declaration behind an id or record and the document it was written in, and says where a guard, value, condition or message was written; Trigger in graph_sites.go also carries the signal, operation, payload name and subsetting. These are additive; no tree field is removed.
  • internal/ir/queryplan: the compiler's declared result reads a lower.Return and a lower.Binding through their accessors.

Behaviour is unchanged: every rendering and every locator answer is the same.

Neither package gains a syntax/ast forbidden edge in tests/hygiene. Both still read the tree legitimately: views attach origins, geometry and styling to declarations, and the query compiler compiles query syntax.

How it was verified

  • Differential over the views: the state and action renderings of every behavior of every model under internal/exec/runtime/testdata/conformance, internal/exec/smt/testdata, examples/ (downloaded corpora included), the analysis and view test data and tests/testdata, 12,823 behaviors, comparing a digest of the rendering or the error text between the base head and this one: no difference. The same sweep over the locators' answers: no difference.
  • New tests: internal/ir/lower/graph_declared_test.go (the new accessors) and internal/ir/view/locate_ids_test.go (the locator by id; graph-only region owners answer for no node, which fails when the locator treats every state as drawn).
  • go build ./..., go vet ./..., gofmt -l . (empty), make lint, go test ./... with the training, pilot and specification-example corpora required (140 packages ok), go test -C tools ./..., go test ./tests/hygiene, make docs-counts, make spec-compliance-check, make changelog-check, make wasm-check.
  • Pilot execution differential: 514 cases, nondeterministic 0, equal to the committed record. pilot-xpect -check: 432 files, 1299 agree, 30 disagree.
  • Size: the gzipped browser REPL build is 16,378,533 bytes (budget 16,400,000); core 7,505,307 (7,600,000); engine 11,142,163 (11,200,000); syntax 1,665,241 (1,800,000). This change moves no budget and touches nothing under tests/wasm.
  • go run -C tools ./cmd/pilot-diff -check fails identically on develop; re-recorded by chore(baselines): re-record the pilot differential for the KerML declaration keyword error #2323. pilot-apijson-diff -check and derived-census -check -require-exporter pass; nothing is re-recorded here.
  • benchstat, n=10, against the base head: REPLEvalExpr 7.084 ms → 6.942 ms (, p=0.105); GRPCEvaluate 14.44 µs → 14.71 µs (, p=1.000); ConnectEvaluateHTTP 114.6 µs → 118.3 µs (~, p=0.393); allocations per op unchanged.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md (nothing user-visible changes)
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build) (none moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 5 commits November 16, 2026 18:22
The behaviour views, the debug locators and the query compiler's declared
result walk the lowered graphs through their id-addressed accessors and
reach a declaration through the graph's provenance. No tree field is
removed, and neither package gains a syntax/ast forbidden edge: both still
read declarations and query syntax.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…yplan-off-tree

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	internal/ir/view/behavior_forms.go
Endpoints resolve by name resolution only, so the fork written in a region
names its branch targets by feature chain and forks into a nested parallel
state; the fixture now holds two parallel states, four graph-only region
states.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

…yplan-off-tree

The action-flow swimlanes develop added are laid over the id-based walk:
a lane holds every node its performer performs, keyed by the node the
walk draws for each id.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Base automatically changed from feat/ir-analysis-sweep-off-tree to develop November 18, 2026 02:09
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 4 commits November 18, 2026 09:33
An accept written `accept :> fall.touchdown` recorded that it subsets
something but no name, so a rendering holding no source labelled it
`accept :>`. The trigger record now carries one name per link and the
label joins them as the notation does.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

devin-ai-integration Bot and others added 2 commits November 18, 2026 10:07
The trigger record joined name segments by hand, dropping a `$::` root
and reading a quoted `::` as a separator. It now holds the notation's
own spelling, which the label writes as it stands.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun added this pull request to the merge queue Nov 18, 2026
@HuiJun
HuiJun removed this pull request from the merge queue due to a manual request Nov 18, 2026
@HuiJun
HuiJun added this pull request to the merge queue Nov 18, 2026
Merged via the queue into develop with commit 04b6706 Nov 18, 2026
32 of 56 checks passed
@HuiJun
HuiJun deleted the feat/ir-view-queryplan-off-tree branch November 18, 2026 23:48
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