Commit graph

618 commits

Author SHA1 Message Date
Lukas Wirth
d28d66bf13
fix: Fix phantom data usage in salsa structs affecting auto traits (#932)
Some checks failed
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
2025-07-04 20:47:07 +00:00
Lukas Wirth
fc00eba89e
Fix heap_size option not being preserved in tracked impls (#930)
Some checks failed
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
2025-07-02 12:34:02 +00:00
github-actions[bot]
572d144b33
chore: release v0.23.0 (#877)
Some checks are pending
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
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-27 11:40:54 +02: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)
Some checks are pending
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)
Some checks failed
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
Vincent Esche
8d14c0251e
Hide generated structs of tracked functions from docs via #[doc(hidden)] (#917)
Some checks are pending
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 / Shuttle (push) Waiting to run
Test / Miri (push) Waiting to run
Test / Benchmarks (push) Waiting to run
2025-06-25 11:19:56 +00:00
Lukas Wirth
8528bab609
feat: Update derive field overwrite support (#747)
Some checks failed
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)
Some checks are pending
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)
Some checks are pending
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
puuuuh
8924db1441
Preserve attributes on interned/tracked struct fields (#905)
Some checks are pending
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
Lukas Wirth
38a3c9e06d
Use Revision and Durability directly in input Value (#902)
`Stamp` contains a lot of padding bytes, wasting 7 bytes per field for inputs due to the array packing.
By packing each field into a separate array we regain that space
2025-06-04 14:26:49 +00:00
Micha Reiser
14318b7266
Update dependencies, remove unused heck dependency (#894)
Some checks are pending
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
* Store tracked struct ids as Vec on Revisions

* Use reserve

* Discard changes to tests/parallel/cycle_a_t1_b_t2_fallback.rs

* Try boxed slice

* Use thinvec

* Update dependencies, remove unused heck

* Discard changes to src/function/diff_outputs.rs

* Discard changes to src/tracked_struct.rs

* Discard changes to src/zalsa_local.rs

* Discard changes to tests/parallel/cycle_a_t1_b_t2_fallback.rs
2025-06-02 10:00:52 +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
github-actions[bot]
a12bf313a4
chore: release v0.22.0 (#840)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-23 12:38:34 +02: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
2d4321e989
Implement an !Update bound escape hatch for tracked fn (#867)
Some checks failed
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)
Some checks are pending
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
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
Lukas Wirth
2c041763b7
refactor: Clean up some unsafety (#830) 2025-05-02 12:16:44 +00:00
github-actions[bot]
fa8409212d
chore: release v0.21.1 (#829)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-01 07:22:49 +02: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
github-actions[bot]
2a3a871f2a
chore: release v0.21.0 (#811)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-29 19:13:06 +02:00
Lukas Wirth
89347c8fc9
Implement a query stack Backtrace analog (#827) 2025-04-29 17:01:15 +00:00
Andrey Nikolaev
0cbe7f86ab
fix: correct debug output for tracked fields (#826) 2025-04-28 13:26:50 +00:00
Lukas Wirth
445b627277
refactor: Simplify ID conversions (#822) 2025-04-28 12:00:16 +00:00
Lukas Wirth
f915b0632e
fix: allow unused lifetimes in tracked_struct expansion (#824) 2025-04-28 11:50:52 +00:00
Lukas Wirth
4fa0ee8dfc
cleanup: Remove unnecessary Array abstraction (#821) 2025-04-28 07:33:31 +00:00
Lukas Wirth
9a9fb4e51b
Add a compile-fail test for a 'static !Update struct (#820) 2025-04-28 07:09:05 +00:00
Andrey Nikolaev
c75b0161ab
squelch most clippy warnings in generated code (#809) 2025-04-27 09:57:45 +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
github-actions[bot]
201a8dd40b
chore: release v0.20.0 (#753)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-22 13:57:53 +02:00
Lukas Wirth
f981e7d0fd
perf: Reduce memory usage by deduplicating type information (#803)
* Reduce memory usage by deduplicating type information

We were storing the type information, 3 words wide, for each memo in each slot, while it is always constant wrt. the ingredient (different slots of the same ingredients will always have the same memos in the same order). This introduces some more unsafety, and the result wasn't as fast so I also had to use some lock-free structures, but the result is worth it: this shaves off 230mb from rust-analyzer with new Salsa.

* Simplify

* Replace `RwLock` with boxcar + `AtomicPtr`

* Use TypeId and allocate instead

* Use `OnceLock` instead of atomic-ptr

---------

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2025-04-22 11:24:23 +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
a89e3d2357
chore: Normalize imports style (#779)
* Default impl some ingredient functions

* chore: Normalize imports style

Effectively reformatted everything with
```toml
imports_granularity = "Module"
group_imports = "StdExternalCrate"
reorder_imports = true
```
2025-03-28 05:11:40 +00:00
Wilco Kusee
8fb172b696
Document most safety blocks (#776)
* Document most safety blocks, allow others with todo

* Remove unused impl
2025-03-23 11:19:52 +00:00
Micha Reiser
1d1523b8b8
bug [salsa-macros]: Improve debug name of tracked methods (#755) 2025-03-17 08:57:50 +00:00
Lukas Wirth
1bbf4c2be5
feat: Drop Debug requirements and flip implementation defaults (#756) 2025-03-15 15:14:34 +00:00
Carl Meyer
095d8b2b81
rewrite cycle handling to support fixed-point iteration (#603) 2025-03-10 22:25:47 +00:00
github-actions[bot]
9ebc8a3913
chore: release v0.19.0 (#698)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-10 15:09:26 +01:00
Lukas Wirth
9d2a9786c4
perf: Store view downcaster in function ingredients directly (#720)
* Store view downcaster in function ingredients directly

* Embed typecheck into the downcaster

* Force inline `db` proc-macro generated functions

* Skip unnecessary type-id check
2025-03-06 10:39:52 +00:00
Carl Meyer
3ffc9a2efe
Option::replace instead of std::mem::replace (#746) 2025-03-05 15:58:56 +00:00
Lukas Wirth
7a45da93c2
Cleanup Cargo.tomls (#745) 2025-03-05 15:45:16 +00:00
Lukas Wirth
a57df6c72d Drop clone requirement for accumulated values 2025-02-28 08:41:14 +01:00
Lukas Wirth
870dbfecef Remove unnecessary current_revision call from setup_interned_struct 2025-02-26 13:08:14 +01:00