Lukas Wirth
679d82c4e7
Gate accumulator feature behind a feature flag ( #946 )
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz PR (push) Waiting to run
Release-plz / Release-plz release (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
2025-08-02 08:41:17 +00:00
Lukas Wirth
211bc158df
Do manual trait casting ( #922 )
...
* Do manual trait upcasting instead of downcasting
* Remove another dynamic `zalsa` call
* Rename UpCaster back to DownCaster
* Address reviews
2025-07-31 15:56:13 +00:00
Ibraheem Ahmed
53cd6b15ba
remove bounds and type checks from IngredientCache
( #937 )
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Release-plz / Release-plz PR (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
2025-07-21 16:10:10 +00:00
Ibraheem Ahmed
0e1df67ec4
Avoid dynamic dispatch to access memo tables ( #941 )
...
* avoid dynamic dispatch to access memo tables
* update comment
2025-07-21 16:09:11 +00:00
Ibraheem Ahmed
dba66f1a37
Use inventory
for static ingredient registration ( #934 )
...
Book / Book (push) Has been cancelled
Release-plz / Release-plz release (push) Has been cancelled
Release-plz / Release-plz PR (push) Has been cancelled
Test / Test (push) Has been cancelled
Test / Miri (push) Has been cancelled
Test / Shuttle (push) Has been cancelled
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled
* use `inventory` for static ingredient registration
* remove unnecessary synchronization from memo tables
* use global ingredient caches for database-independent ingredients
* add manual ingredient registration API
* remove static ingredient index optimization when manual registration is in use
* fix atomic imports
* simplify ingredient caches
2025-07-18 04:55:50 +00:00
Lukas Wirth
f384ab538e
Emit self ty for query debug name of assoc function queries ( #927 )
2025-06-27 09:23:25 +00:00
Ibraheem Ahmed
d44f638408
Replace ingredient cache with faster ingredient map ( #921 )
...
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Release-plz / Release-plz PR (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
* replace ingredient cache with faster ingredient map
* avoid checking for downcasters in ingredient cache slow-path
* pre-size ingredient map
* avoid double lookup in ingredient creation slow-path
2025-06-27 07:19:58 +00:00
Ibraheem Ahmed
0666e2018b
add option to track heap memory usage of memos ( #925 )
Book / Book (push) Has been cancelled
Release-plz / Release-plz release (push) Has been cancelled
Release-plz / Release-plz PR (push) Has been cancelled
Test / Test (push) Has been cancelled
Test / Miri (push) Has been cancelled
Test / Shuttle (push) Has been cancelled
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled
2025-06-25 20:26:49 +00:00
Ibraheem Ahmed
c145596ef8
Add API to dump memory usage ( #916 )
...
Book / Book (push) Has been cancelled
Release-plz / Release-plz release (push) Has been cancelled
Release-plz / Release-plz PR (push) Has been cancelled
Test / Test (push) Has been cancelled
Test / Shuttle (push) Has been cancelled
Test / Miri (push) Has been cancelled
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled
* add memory usage information hooks
* gate memory usage API under `salsa_unstable` feature
* use snapshot tests for memory usage API
2025-06-20 17:15:43 +00:00
Lukas Wirth
8528bab609
feat: Update
derive field overwrite support ( #747 )
...
Release-plz / Release-plz PR (push) Has been cancelled
Book / Book (push) Has been cancelled
Release-plz / Release-plz release (push) Has been cancelled
Test / Test (push) Has been cancelled
Test / Miri (push) Has been cancelled
Test / Shuttle (push) Has been cancelled
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled
* `Update` derive field overwrite support
* Allow overwriting tracked struct field update functions
2025-06-13 17:17:39 +00:00
Ibraheem Ahmed
b8cdd300a0
add an option to tune interned garbage collection ( #911 )
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz PR (push) Waiting to run
Release-plz / Release-plz release (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
2025-06-13 06:17:45 +00:00
Lukas Wirth
6ced42b334
Use explicit discriminants for QueryOriginKind
for better comparisons ( #913 )
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Release-plz / Release-plz PR (push) Waiting to run
Test / Benchmarks (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
2025-06-12 18:32:33 +00:00
Ibraheem Ahmed
dc9066d667
use latest revision for dependencies on interned values ( #908 )
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Release-plz / Release-plz PR (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
2025-06-11 06:03:30 +00:00
Ibraheem Ahmed
4161bd727f
remove high-durability values from interned LRU ( #907 )
2025-06-11 05:28:08 +00:00
puuuuh
8924db1441
Preserve attributes on interned/tracked struct fields ( #905 )
...
Release-plz / Release-plz PR (push) Waiting to run
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Test / Test (push) Waiting to run
Test / Benchmarks (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
* Preserve attributes on interned/tracked structs
* Pass unknown attributes from fields to getter functions in inputs
2025-06-10 06:34:54 +00:00
Carl Meyer
a95bae5119
panic with string message again for cycle panics ( #898 )
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Release-plz / Release-plz PR (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
2025-06-04 15:15:22 +00:00
Lukas Wirth
2c57c5628b
Fix flaky parallel_join test ( #900 )
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Release-plz / Release-plz PR (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
2025-06-04 12:24:15 +00:00
Ibraheem Ahmed
15c28cdf88
Simple LRU garbage collection for interned values ( #839 )
...
* simple LRU garbage collection for interned values
* shard interned values
* gate memo size assertion to 64-bit platforms
* extend internal documentation for interned structs
* remove `first_interned_at` field from interned values
* clarify difference between tracked and interned structs
* only keep track of low durability interned values for garbage collection
2025-06-04 08:09:04 +00:00
Micha Reiser
2b5188778e
fix: multithreaded nested fixpoint iteration ( #882 )
...
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Shuttle (push) Waiting to run
Test / Benchmarks (push) Waiting to run
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz release (push) Waiting to run
Release-plz / Release-plz PR (push) Waiting to run
* Set `validate_final` in `execute` after removing the last cycle head
* Add runaway query repro
* Add tracing
* Fix part 1
* Fix `cycle_head_kinds` to always return provisional for memos that aren't verified final (They should be validated by `validate_same_iteration` or wait for the cycle head
* Fix cycle error
* Documentation
* Fix await for queries depending on initial value
* correctly initialize queued
* Cleanup
* Short circuit if entire query runs on single thread
* Move parallel code into its own method
* Rename method, add self_key to queued
* Revert self-key changes
* Move check *after* `deep_verify_memo`
* Add a test for a cycle with changing cycle heads
* Short circuit more often
* Consider iteration in `validate_provisional`
* Only yield if all heads result in a cycle. Retry if even just one inner cycle made progress (in which case there's a probably a new memo)
* Fix hangs
* Cargo fmt
* clippy
* Fix hang if cycle initial panics
* Rename `cycle_head_kind` enable `cycle_a_t1_b_t2_fallback` shuttle test
* Cleanup
* Docs
2025-06-01 08:45:37 +00:00
puuuuh
f9a9bb2a6a
Don't report stale outputs if there is newer generation in new_outputs ( #879 )
...
Book / Book (push) Has been cancelled
Release-plz / Release-plz release (push) Has been cancelled
Release-plz / Release-plz PR (push) Has been cancelled
Test / Test (push) Has been cancelled
Test / Miri (push) Has been cancelled
Test / Shuttle (push) Has been cancelled
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled
* Don't report stale outputs if there is newer generation in new_outputs
* Remove outdated comment, add explanation why we ignore generation in diff_outputs
2025-05-27 17:44:15 +00:00
Micha Reiser
e1fe3698ce
Fix hang in nested fixpoint iteration ( #871 )
2025-05-27 17:06:34 +00:00
Chayim Refael Friedman
2a54667121
Allow lifetimes in arguments in tracked fns with >1 parameters ( #880 )
2025-05-26 04:50:43 +00:00
Ibraheem Ahmed
0414d89327
Replace loom with shuttle ( #876 )
...
* replace loom with shuttle
* inline `empty_cycle_heads`
* ignore failing shuttle test
2025-05-23 15:28:51 +00:00
Ibraheem Ahmed
f7b08562ed
Use generational identifiers for tracked structs ( #864 )
...
* use generational identifiers for tracked structs
* increase ID generations to 32-bits
* remove `created_at` field from tracked structs
* clean up tracked struct IDs to handle overflow
* log tracing message for leaked tracked structs
2025-05-23 14:18:03 +00:00
Vincent Esche
e859218dea
Allow creation of tracked associated functions (without self
) ( #859 )
...
* Rename file "setup_method_body.rs" to "setup_tracked_method_body.rs"
* Rename macro `setup_method_body!` to `setup_tracked_method_body!`
* Add support for tracked associated functions
* Rename struct `MethodArguments` to `AssociatedFunctionArguments`
(since every method is an associated function, but not every associated function is a method)
2025-05-23 10:19:12 +00:00
Lukas Wirth
4327d6bb94
Unwind with specific type when encountering an unexpected cycle ( #856 )
2025-05-22 07:40:11 +00:00
Lukas Wirth
2d4321e989
Implement an !Update
bound escape hatch for tracked fn ( #867 )
Book / Book (push) Has been cancelled
Release-plz / Release-plz release (push) Has been cancelled
Release-plz / Release-plz PR (push) Has been cancelled
Test / Test (push) Has been cancelled
Test / Miri (push) Has been cancelled
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled
2025-05-20 15:36:34 +00:00
Micha Reiser
96eeecb5af
Remove default PartialOrd
and Ord
derives for salsa-structs ( #868 )
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Release-plz / Release-plz PR (push) Waiting to run
Release-plz / Release-plz release (push) Waiting to run
Test / Test (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Benchmarks (push) Waiting to run
2025-05-19 11:57:23 +00:00
Micha Reiser
7edce6e248
Fix returns(deref | as_ref | as_deref) in tracked methods ( #857 )
2025-05-09 09:09:16 +00:00
CheaterCodes
13a2bd7461
Changed return_ref
syntax to returns(as_ref)
and returns(cloned)
( #772 )
...
* Changed `return_ref` syntax to `returns(as_ref)` and `returns(cloned)`
* Implement
* renamed module for return_mode
* Rename macro, fix docs, add tests, validate return modes
* Cargo fmt
---------
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-09 07:28:54 +00:00
Micha Reiser
a6793e783a
Lazy finalization of cycle participants in maybe_changed_after
( #854 )
...
* Lazy verification of cycle participants in maybe_changed_after
* Update comment
2025-05-09 07:03:54 +00:00
Lukas Wirth
af69cc1114
Do not re-verify already verified memoized value in cycle verification ( #851 )
2025-05-08 16:33:58 +00:00
Lukas Wirth
00dbf01e87
Pass cycle heads as out parameter for maybe_changed_after
( #852 )
2025-05-08 08:32:27 +00:00
Lukas Wirth
cfa88e9a4d
Move salsa event system into Zalsa
( #849 )
...
* Move salsa event system into `Zalsa`
* Encode `None` into ShallowUpdate
This shrinks the return value from 16 to 8 bytes
2025-05-07 11:45:49 +00:00
Ibraheem Ahmed
54020469a3
Add loom support ( #842 )
...
* add support for loom tests
* add just script and fix comment
2025-05-06 15:36:38 +00:00
Micha Reiser
b2b82bccdb
fix: change detection for fixpoint queries ( #836 )
...
* bug: Fix missing cycle inputs
* Pass provisional as old memo to `execute_query` during fixpoint
* Remove `provisional` from remove stale output
* Revert debug code
* Update test
* Some documentation
* Clean up tests
* Fix for direct enclosing query
* Format
* More comment fiddling
* Revert copy only outputs change
* Revert `fixpoint_initial` start revision change (worth its own PR)
* Align fixpoint handling with Derived
* Preserve cycle heads when returning fixpoint initial
* Always return changed for `Fixpoint::Initial`
* Keep returning unchanged in some cases
2025-05-06 08:11:31 +00:00
Micha Reiser
ad3dff6cb3
better debug name for interned query arguments ( #837 )
...
* feat: Improve debug name for interned query arguments
* Change name again
2025-04-30 17:20:49 +00:00
Lukas Wirth
89347c8fc9
Implement a query stack Backtrace
analog ( #827 )
2025-04-29 17:01:15 +00:00
Micha Reiser
b27e3927e9
fix: Access to tracked-struct that was freed during fixpoint ( #817 )
...
* Add test for untracked read on tracked struct created in previous cycle
* Initial fix
* Restrict seeding to memos from the same revision
* Reduce changes
* seed_outputs
* Cleanup test
* Add assertion
* Try
* Try merging outputs after query executed
* Assert logs from first execution
* Enable trace level logging
* Use `FxIndexSet` in `diff_outputs`
* Log more events
* Cleanup
* Append outputs only once
2025-04-28 14:24:33 +00:00
Lukas Wirth
445b627277
refactor: Simplify ID conversions ( #822 )
2025-04-28 12:00:16 +00:00
Lukas Wirth
9a9fb4e51b
Add a compile-fail test for a 'static
!Update
struct ( #820 )
2025-04-28 07:09:05 +00:00
Micha Reiser
f7eea9d69b
Use DatabaseKey
for interned events ( #813 )
...
* Use `DatabaseKey` for interned events
* Tame clippy
2025-04-24 10:38:46 +00:00
Chayim Refael Friedman
cf9efae0da
Make interned's last_interned_at
equal Revision::MAX
if they are interned outside a query ( #804 )
...
There is an assert that `last_interned_at >= last_changed_revision`, and it can fail without this, see the added test.
2025-04-22 10:42:17 +00:00
Chayim Refael Friedman
05b4faddb5
Add a third cycle mode, equivalent to old Salsa cycle behavior ( #801 )
...
That is, directly set a value for all queries that have fallbacks, and ignore all other queries in the cycle.
Unlike old Salsa, we still need all cycle heads to be marked, and we still execute the queries to completion, but we throw their result.
2025-04-22 10:35:43 +00:00
Lukas Wirth
883baaf8de
refactor: Inline/Outline more cold and slow paths ( #805 )
2025-04-21 10:40:22 +00:00
Lukas Wirth
3820cac9a4
Remove incorrect parallel_scope
API ( #797 )
...
Rayon does not allow joining on the spawns, meaning we might end up with results in the tests before reading out the panics
2025-04-16 14:09:35 +00:00
Carl Meyer
87bf6b6c2d
add WillIterateCycle event ( #790 )
...
* add WillIterateCycle event
* add iteration_count and fell_back to event
2025-04-10 13:13:17 +00:00
Micha Reiser
69272a8fe6
fix: Dereferencing freed memos when verifying provisional memos ( #788 )
...
* Add test
* Fix `fetch_hot` and `maybe_changed_after`
2025-04-09 16:39:23 +00:00
Carl Meyer
296a8c78da
allow reuse of cached provisional memos within the same cycle iteration ( #786 )
...
* test for caching provisional values
* add iteration-count to cycle heads
* CycleHeads insert/extend checks iteration count match
* update iteration count in cycle heads
* all tests passing
* remove debug prints
* just walk active query stack once
* switch to tracking active cycle iterations on ZalsaLocal
* Revert "switch to tracking active cycle iterations on ZalsaLocal"
This reverts commit 4ea3d850b53a449dda7af7ceb4cc565d3a64001c.
* Revert "just walk active query stack once"
This reverts commit 2d7948612be3f411c7787829ff2db74e3a575f0c.
* make ActiveQuery::iteration_count private with accessor
* iterate active query stack in reverse
* use tracing::trace! in hot path
* try a cold annotation on validate_same_iteration
* Revert "try a cold annotation on validate_same_iteration"
This reverts commit 49ceb84bb7
.
2025-04-03 15:10:50 +00:00
Lukas Wirth
395b29d08a
fix: #[doc(hidden)]
plumbing
module ( #781 )
2025-04-03 10:55:23 +00:00