Skip to content

Add tests for cancellation in fixpoints#1085

Open
Veykril wants to merge 1 commit intosalsa-rs:masterfrom
Veykril:veykril/push-nkqvvltwzplm
Open

Add tests for cancellation in fixpoints#1085
Veykril wants to merge 1 commit intosalsa-rs:masterfrom
Veykril:veykril/push-nkqvvltwzplm

Conversation

@Veykril
Copy link
Copy Markdown
Member

@Veykril Veykril commented Apr 16, 2026

revision_bump_clears_poisoned_memo replicates the issue discussed in #1063

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit a3590b7
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/69e09fdd6f025b000845aba4

let t2 = thread::spawn({
let mut db_writer = db_writer;
move || {
db_writer.trigger_lru_eviction();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess we have the same problem when someone calls trigger_cancellation, since it doesn't bump a new revision either.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yea, both of those have the same issue. We don't really need to merge this right now, just put this up so I don't lose it. So yea, unsure what we wanna do here, either we need to remove these functions (which would be a shame, their point is that they do not bump the revision), or we need to figure out how to handle poisoning differently. In r-a we'll avoid calling these for now as the gain from their use is marginal.

@MichaReiser
Copy link
Copy Markdown
Contributor

What makes cycle recovery tricky is that there's no guarantee that queries will be executed in the same order after they've been cancelled. E.g., if we have a -> b -> a ' and the query gets canceled, there's a chance that the execution plan now is executed b -> a -> b`.

A possibility is to walk the entire dependency tree and nuke all memos.

@Veykril
Copy link
Copy Markdown
Member Author

Veykril commented Apr 16, 2026

You mean the plan changes the next time someone enters the cycle? What would be the issue with it changing?

@MichaReiser
Copy link
Copy Markdown
Contributor

You mean the plan changes the next time someone enters the cycle? What would be the issue with it changing?

Yes, because the user calls a different root query.

The issue with it is that it requires invalidating all provisional memoized values that participated in the query because the iteration count isn't sufficient to distinguish a provisional memoized value that was computed when entering from a from one computed when entering from b (and the values from iteration 2 could be different dependend on what the root query is)

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.

2 participants