feat(vm): refine branches with path facts - #736
Open
Jon-Becker wants to merge 1 commit into
Open
Conversation
Contributor
❌ AI Evaluation SuiteThe heimdall-eval run failed. See the workflow run for details.
|
Contributor
✅ Coverage Report for 809c61e
|
Jon-Becker
force-pushed
the
feat/path-fact-refinement
branch
from
September 6, 2026 21:37
f2857f1 to
f9f439c
Compare
Jon-Becker
force-pushed
the
feat/path-fact-refinement
branch
from
September 6, 2026 23:40
f9f439c to
04cdeea
Compare
Contributor
Benchmark for 809c61eClick to view benchmark
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed? Why?
Stacked on #734 (after #733, #732, and #730).
Adds lightweight path predicates to the abstract CFG state and applies true/false assumptions on
JUMPIedges. Repeated or logically implied conditions can now be proven infeasible without enumerating concrete executions or invoking an SMT solver.Path fact domain
Refinement
ISZEROEQ, unsignedLT, and unsignedGT(value & mask) == constantfacts to the unmasked valueExpression interning is also made fully structural: equivalent expressions computed at different PCs share one
ExprId, while the arena separately records all producer sites. This is required for a later read ofCALLDATASIZE,CALLER, or an equivalent expression to reuse facts established by an earlier branch.Notes to reviewers
Key files:
crates/vm/src/core/facts.rs: constraints, assumptions, joins, implication checks, and testscrates/vm/src/core/analysis.rs: fact-bearing states and branch-specific successorscrates/vm/src/core/context.rs: contextual branch refinement and diagnosticscrates/vm/src/core/symbolic.rs: structural interning with separate producer-site trackingcrates/vm/src/core/mod.rs: exports the fact domainThis is deliberately a cheap, incomplete bit-vector domain. Signed comparisons, complex arithmetic implications, and expressions outside these rules remain unknown for the next demand-driven SMT stage.
Exploratory 100-contract run
Compared with #734 over the same first 100
largest1kcontracts:The graph is smaller because infeasible directions are removed and fewer downstream contexts are created. Structural interning accounts for the expression-count reduction. The ten-block decrease is consistent with pruning but is not yet a ground-truth precision claim. The runtime increase identifies path-fact representation and cloning as optimization targets before production migration.
How has it been tested?
cargo +nightly fmt --check --allheimdall-vmwith repository-standard allowancescargo test --workspace --lib --testslargest1kexploratory run with no failures