Skip to content

Conversation

MichaReiser
Copy link
Contributor

Run a single fixpoint iteration for strongly connected components
to avoid exponential runtime for deeply nested cycles.

TODO:

  • Documentation
  • Investigate perf regressions
  • Test that demonstrates the "collapsing" of nested cycles
  • Review if there are any changes necessary to maybe_changed_after
  • Investigate why cycle_nested_deep_conditional_changed::the_test sometimes hangs or panics

Copy link

netlify bot commented Oct 6, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 058fa5b
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/68e69e6062d4a300080e0186

Copy link

codspeed-hq bot commented Oct 6, 2025

CodSpeed Performance Report

Merging #999 will degrade performances by 14.34%

Comparing MichaReiser:fixpoint-scc-sync-table (058fa5b) with master (adf0556)

Summary

❌ 7 regressions
✅ 5 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
amortized[Input] 2.2 µs 2.4 µs -10.21%
amortized[InternedInput] 2.2 µs 2.3 µs -4.29%
amortized[SupertypeInput] 2.8 µs 3 µs -6.41%
new[Input] 9.8 µs 10.3 µs -4.75%
new[SupertypeInput] 15.6 µs 16.3 µs -4.16%
mutating[10] 13.7 µs 14.3 µs -4.2%
converge_diverge 126.9 µs 148.1 µs -14.34%

@MichaReiser
Copy link
Contributor Author

MichaReiser commented Oct 6, 2025

Hmm, I'm surprised that this is even slower than #995, considering that most logic now lives directly in DependencyGraph. I suppose the downside is that we incur the cost of transferring the outer head in all cases, even if the entire calculation occurs on a single thread. That might be an issue for ty, ugh.

Either way. I think there are some optimization opportunities:

  1. Avoid calling unblock in more cases
  2. Add a method to DependencyGraph to determine if all queries form a cycle (rather than having many wait_for calls)

@MichaReiser MichaReiser force-pushed the fixpoint-scc-sync-table branch from e14d70d to 179050d Compare October 8, 2025 13:05
@MichaReiser MichaReiser force-pushed the fixpoint-scc-sync-table branch from a2b3da6 to 058fa5b Compare October 8, 2025 17:24
let database_key_index = self.database_key_index(key_index);

let _claim_guard = match self.sync_table.try_claim(zalsa, key_index) {
let _claim_guard = match self.sync_table.try_claim(zalsa, key_index, false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this be true or false???

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.

1 participant