BE-523: HashQL: Suspendable interpreter with structured values and input system#8675
Conversation
feat: make Int size aware feat: postgres serialization feat: checkpoint feat: checkpoint feat: checkpoint feat: errors feat: psql codec feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: move bridge -> orchestrator feat: move bridge -> orchestrator feat: organize the runtime a bit more feat: organize the runtime a bit more feat: checkpoint feat: checkpoint feat: checkpoint feat: checkpoint feat: organize the runtime a bit more feat: finish orchestrator first version feat: finish orchestrator first version feat: feat: move out suspension requests to own module chore: clippy feat: split out into more manageable functions feat: split out into more manageable functions chore: orchestrator docs feat: organize the runtime a bit more feat: test orchestrator feat: better symbol repr feat: orchestrator test harness feat: orchestrator test harness feat: orchestrator test harness feat: orchestrator test harness feat: orchestrator test harness feat: test orchestrator feat: pipeline feat: bless snapshots chore: tests chore: masking chore: tests fix: SSA repair chiore: ssa repair snapshots feat: orchestrator test harness chore: remove spec fix: library features chore: update snapshots chore: update docs
PR SummaryHigh Risk Overview Replaces ad-hoc input passing with a dedicated Updates runtime value infrastructure: Reviewed by Cursor Bugbot for commit 4082a24. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## bm/be-522-hashql-expand-stdlib-type-definitions #8675 +/- ##
===================================================================================
- Coverage 62.25% 62.21% -0.05%
===================================================================================
Files 1354 1354
Lines 137104 136863 -241
Branches 5793 5771 -22
===================================================================================
- Hits 85360 85155 -205
+ Misses 50837 50811 -26
+ Partials 907 897 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
deb5f19 to
7d9f781
Compare
b2d61fe to
4cc8b7a
Compare
4cc8b7a to
7be336d
Compare
7be336d to
e2fda5b
Compare
3cb3bf5 to
dd10bcf
Compare
e2fda5b to
50368b6
Compare
dd10bcf to
ffd9997
Compare
50368b6 to
6499ac2
Compare
6499ac2 to
d005e5a
Compare
89ae7c2 to
9047680
Compare
d005e5a to
4082a24
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4082a24. Configure here.
|
|
||
| // Interval(Struct { start, end }) | ||
| let interval_fields = interner.symbols.intern_slice(&[sym::end, sym::start]); | ||
| let interval_struct = Struct::new_unchecked(interval_fields, Rc::new([end_bound, start_bound])); |
There was a problem hiding this comment.
Interval field order swaps start and end bounds
Medium Severity
In make_temporal_axes, the interval_fields are interned as [sym::end, sym::start] (sorted alphabetically), but the values Rc::new([end_bound, start_bound]) pair end with end_bound at index 0 and start with start_bound at index 1. While this happens to be correct for this specific ordering, the construction is fragile and easy to misread — the fields array reads [end, start] while semantically one expects [start, end]. More importantly, the Struct::new_unchecked invariant requires fields to be sorted, and the code relies on "end" < "start" alphabetically. If the field names ever changed, or if Symbol ordering changed, the pairing would silently break because the values array order must match the fields array order but is written in a confusing [end_bound, start_bound] order rather than a clear correspondence.
Reviewed by Cursor Bugbot for commit 4082a24. Configure here.



🌟 What is the purpose of this PR?
Rework the MIR interpreter to support suspend/resume execution, richer value representations, and a proper input system. Together these let the interpreter pause when it needs external data (e.g. a database query), hand back a structured description of what it needs, and resume once the caller provides the result.
🔍 What does this change?
Suspension model (
interpret/suspension/)GraphReadterminator it yields aSuspensioninstead of blocking. Callers drive astart/resumeloop until they get aReturn.GraphReadSuspensionextracts temporal axes, filter parameters, and entity type from the suspended state.Continuationcarries the response value that resumes execution.TemporalAxesInterval/Timestampgive structured representations of the temporal query window.Runtime::runconvenience wrapper for callers that can fulfill suspensions synchronously.Input system (
interpret/inputs.rs)Inputs<'heap, A>: a typed map from interned symbols toValues, consulted forInputOp::LoadandInputOp::Exists. Replaces the unstructuredFastHashMappreviously threaded through the runtime. Supports both global and custom allocators.Value representation (
interpret/value/)Int: carry bit-width (1-bit boolean vs 128-bit integer) so serialization can distinguishtrue/falsefrom0/1without external type info. Arithmetic promotes to 128-bit; bitwise boolean ops preserve 1-bit.Struct: addStructBuilder<N>for stack-allocated fixed-field construction. Enforce sorted field invariant. Addmergeandproject_by_name.Opaque,Listallocator parameterization,Strdisplay.SSA repair fix (
pass/transform/ssa_repair)Entity path type resolution (
pass/execution/traversal)field_pathandresolve_typetoEntityPathfor navigating from an entity path (e.g.WebId,Properties) to its concrete stdlib type.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
None
🐾 Next steps
hashql-evalconsumes the suspension model and input system introduced here.🛡 What tests cover this?
interpret/tests.rs): cover the suspend/resume loop, input resolution, and value operations.tests/ui/pass/ssa_repair): cover the block parameter and terminator fixes.Intrepresentation change.❓ How to test this?
cargo nextest run --package hashql-mircargo test --package hashql-mir --doc