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 Introduces an Reworks core interpreter data structures and values: Reviewed by Cursor Bugbot for commit 4cc8b7a. 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❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## bm/be-522-hashql-expand-stdlib-type-definitions #8675 +/- ##
===================================================================================
+ Coverage 68.05% 68.31% +0.26%
===================================================================================
Files 909 925 +16
Lines 85798 88683 +2885
Branches 4539 4581 +42
===================================================================================
+ Hits 58386 60584 +2198
- Misses 26828 27495 +667
- Partials 584 604 +20
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:
|
dae3f47 to
0a89a10
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 0a89a10. Configure here.
627f81a to
deb5f19
Compare
0a89a10 to
b2d61fe
Compare
🤖 Augment PR SummarySummary: This PR upgrades the HashQL MIR interpreter to support structured runtime values and a suspend/resume execution model for external data access. Changes:
Technical Notes: Interpreter execution can now be driven synchronously via 🤖 Was this summary useful? React with 👍 or 👎 |
| BinOp::BitAnd => return Some(lhs & rhs), | ||
| BinOp::BitOr => return Some(lhs | rhs), | ||
| // Comparisons produce booleans | ||
| BinOp::Eq => lhs.as_int() == rhs.as_int(), |
There was a problem hiding this comment.
libs/@local/hashql/mir/src/pass/transform/inst_simplify/mod.rs:262: eval_bin_op uses lhs.as_int()/rhs.as_int() for comparisons, which drops the new Int size/provenance (bool vs int) and makes const-folding potentially disagree with runtime comparisons. Consider using the Int comparison impls directly so folding matches interpreter behavior.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
deb5f19 to
7d9f781
Compare
b2d61fe to
4cc8b7a
Compare


🌟 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