Skip to content

Filter stale rows in constrained bounded scans - #964

Merged
yihozhang merged 5 commits into
egraphs-good:mainfrom
fereidani:main
Aug 4, 2026
Merged

Filter stale rows in constrained bounded scans#964
yihozhang merged 5 commits into
egraphs-good:mainfrom
fereidani:main

Conversation

@fereidani

Copy link
Copy Markdown
Contributor

Fixes following example's panic:

(sort V)
(constructor K (i64) V)
(constructor Add (i64 V V) V :cost 100000)
(constructor Shl (i64 V V) V :cost 100000)
(constructor LEA (V V i64 i64) V :cost 1)
(constructor ADD64 (V V) V :cost 1)

(ruleset algebra)
(birewrite (Add w (Add w a b) c) (Add w a (Add w b c)) :ruleset algebra)
(rewrite (Add w a a) (Shl w a (K one))
    :when ((= one (+ w 1))) :ruleset algebra)

(ruleset x64)
(birewrite (ADD64 a b) (Add 64 a b) :ruleset x64)
(rewrite (Add 64 b i) (LEA b i 1 0) :ruleset x64)
(rewrite (LEA b i 1 d) (Add 64 b (Add 64 i (K dv)))
    :when ((= dv (+ d 0))) :ruleset x64)
(rewrite (Add 64 b (Add 64 i (K dv))) (LEA b i 1 d)
    :when ((= d (+ dv 0))) :ruleset x64)

(let $root (ADD64 (K 21) (K 21)))

(run-schedule (repeat 6 (seq (run x64) (run algebra))))

@fereidani
fereidani requested a review from a team as a code owner July 30, 2026 00:12
@fereidani
fereidani requested review from oflatt and removed request for a team July 30, 2026 00:12

@yihozhang yihozhang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great catch, thank you!

Could you add the reproduction example to the tests folder and add a small comment on RowBuffer::get_row_unchecked that it should not be used if stale rows are undesired?

@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.59%. Comparing base (53b9721) to head (99c3118).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #964      +/-   ##
==========================================
- Coverage   86.59%   86.59%   -0.01%     
==========================================
  Files          95       95              
  Lines       29676    29676              
==========================================
- Hits        25699    25698       -1     
- Misses       3977     3978       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Jul 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 37 untouched benchmarks
⏩ 227 skipped benchmarks1


Comparing fereidani:main (99c3118) with main (53b9721)2

Open in CodSpeed

Footnotes

  1. 227 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (99c3118) during the generation of this report, so 53b9721 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@fereidani

Copy link
Copy Markdown
Contributor Author

Great project! Happy to contribute! I applied the changes.

@yihozhang yihozhang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

Remove trailing whitespace and repair a broken sentence (dangling
'either' with no matching clause).
'make test' was failing because the new tests/repro-stale-rows.egg
test had no committed snapshot, so cargo-insta flagged it as a
pending review (matches the failing CI 'test' check on this PR).
@yihozhang

Copy link
Copy Markdown
Collaborator

Pushed two small follow-ups:

  • Fixed the safety doc comment on RowBuffer::get_row_unchecked (trailing whitespace + a broken sentence with a dangling "either").
  • Added the missing cargo insta snapshot for tests/repro-stale-rows.egg — this is why the "test" CI check was failing; make test passes locally now.

@yihozhang
yihozhang merged commit 716c320 into egraphs-good:main Aug 4, 2026
34 checks passed
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.

3 participants