Skip to content

fix: accumulated values lost when reused tracked fn skips re-execution#1099

Open
SAY-5 wants to merge 1 commit into
salsa-rs:masterfrom
SAY-5:fix-accumulator-wrongresult-issue-923
Open

fix: accumulated values lost when reused tracked fn skips re-execution#1099
SAY-5 wants to merge 1 commit into
salsa-rs:masterfrom
SAY-5:fix-accumulator-wrongresult-issue-923

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 26, 2026

When a tracked fn's inputs haven't changed, maybe_changed_after_cold fast-paths through deep_verify_memo and returns the VerifyResult directly. That result carries the accumulated flag from the fn's edge inputs only; if the fn itself pushed accumulated values, those are ignored. Callers upstream then see Empty and skip traversing this subtree, so accumulated values are silently dropped.

Fix: after deep_verify succeeds, check whether the memo's own AccumulatedMap is non-empty and return Any in that case, matching what the re-execute path already does (lines 229-232).

Fixes #923.

…cute

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 26, 2026

👷 Deploy Preview for salsa-rs processing.

Name Link
🔨 Latest commit 16ab655
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/6a1554255469c80008d7267c

@netlify
Copy link
Copy Markdown

netlify Bot commented May 26, 2026

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 16ab655
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/6a1554255469c80008d7267c

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 26, 2026

Merging this PR will improve performance by 10.65%

⚡ 1 improved benchmark
✅ 25 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation amortized[InternedInput] 2.1 µs 1.9 µs +10.65%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing SAY-5:fix-accumulator-wrongresult-issue-923 (16ab655) with master (7e77c49)

Open in CodSpeed

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.

Accumulator misses accumulated values when behind tracked fn

1 participant