Commit graph

586 commits

Author SHA1 Message Date
Phoebe Szmucer
c9f22f108a Use a stack and push to it in reverse order 2024-07-22 11:28:54 +01:00
Niko Matsakis
5f35a3529d
Merge pull request #512 from camelid/unit-update
Impl `Update` for unit type `()`
2024-07-22 09:27:09 +00:00
Phoebe Szmucer
2d490e245a newline 2024-07-22 10:21:16 +01:00
Phoebe Szmucer
4543063f5a use a queue 2024-07-22 10:19:36 +01:00
Phoebe Szmucer
a20c6341ec Use Vec 2024-07-21 18:20:26 +01:00
Phoebe Szmucer
beedbd18e5 Refactor 2024-07-21 18:18:02 +01:00
Phoebe Szmucer
148e1cfecf Fix accumulator only accumulating direct children 2024-07-20 19:55:20 +01:00
Niko Matsakis
83de15ff3c satisfy the merciless cargo fmt 2024-07-19 09:51:24 -04:00
Niko Matsakis
949828d942 remove unused delete method 2024-07-19 09:49:22 -04:00
Niko Matsakis
1133c72e77 require reset for new revisions 2024-07-19 09:49:08 -04:00
Niko Matsakis
e847929536 pacify the merciless clippy 2024-07-19 09:20:41 -04:00
Niko Matsakis
ad61687e83 wip 2024-07-19 08:09:55 -04:00
Niko Matsakis
b677019407 fix accumulation 2024-07-19 06:22:40 -04:00
Niko Matsakis
92eee06596 delete a bunch of dead code 2024-07-19 05:55:40 -04:00
Niko Matsakis
c545f8a8c3 wip 2024-07-18 07:50:22 -04:00
Niko Matsakis
812923ab0c wip 2024-07-18 07:49:06 -04:00
Niko Matsakis
b7e6bc62af make methods work 2024-07-18 06:03:34 -04:00
Niko Matsakis
b08015e639 wip 2024-07-17 08:56:08 -04:00
Niko Matsakis
2213729c4e wip 2024-07-17 08:42:06 -04:00
Niko Matsakis
daba89c278 wip 2024-07-17 08:21:07 -04:00
Niko Matsakis
c9426d2e4f wip 2024-07-17 06:54:24 -04:00
Niko Matsakis
7443277381 wip 2024-07-17 06:41:56 -04:00
Niko Matsakis
30f122eaac wip 2024-07-17 05:47:56 -04:00
Niko Matsakis
5963e118b9 wip 2024-07-17 05:33:51 -04:00
Niko Matsakis
8a39bf029b wip 2024-07-16 06:04:01 -04:00
Niko Matsakis
612cec6703 wip 2024-07-15 20:29:36 -04:00
Niko Matsakis
fdc363b65f wip 2024-07-15 07:46:23 -04:00
Niko Matsakis
57eb0c45b4 wip: iterate towards hello_world
Some checks failed
Book / Book (push) Has been cancelled
Test / Test (false, beta) (push) Has been cancelled
Test / Test (false, stable) (push) Has been cancelled
Test / Test (true, nightly) (push) Has been cancelled
Test / Miri (push) Has been cancelled
Book / Deploy (push) Has been cancelled
2024-07-14 13:49:59 -04:00
Niko Matsakis
231dc4f713 wip: inputs 2024-07-14 13:36:30 -04:00
Niko Matsakis
b72add2df8 wip 2024-07-13 11:44:17 -04:00
Niko Matsakis
4c998c78e4 wip 2024-07-13 11:41:19 -04:00
Niko Matsakis
dde7341f97 create macro-rules macros to encapsulate output
This is a new idea for how to manage procedural
macros, which I kind of hate.
2024-07-13 05:45:22 -04:00
Niko Matsakis
73b8134345 WIP checkpoint 2024-07-12 07:51:28 -04:00
Niko Matsakis
15106ff8ea reorganize plumbing 2024-07-12 07:11:31 -04:00
Niko Matsakis
65118a0fe6 Send + Sync requirements 2024-07-12 05:59:47 -04:00
Niko Matsakis
a1651c89d9 WIP 2024-07-11 21:35:37 -04:00
Niko Matsakis
2cfb75837b WIP 2024-07-11 07:30:26 -04:00
Niko Matsakis
15d5f213c5 WIP 2024-07-11 06:22:02 -04:00
Niko Matsakis
99ac6e89ef WIP adopt concurrent-vec 1.10 2024-07-11 05:47:18 -04:00
Niko Matsakis
c84bd1b5c2 WIP new approach with upcasts 2024-07-10 08:13:00 -04:00
Niko Matsakis
fe1b06a48a WIP-- checkpoint, dynamic jars 2024-07-08 06:25:32 -04:00
Niko Matsakis
380b19cc39 remove debug_name from function ingredients 2024-07-06 08:42:15 -04:00
Niko Matsakis
aaf8f0bf4f remove debug_name field from interned 2024-07-06 08:40:09 -04:00
Niko Matsakis
204f4eea6f move struct debug name to Configuration 2024-07-06 08:34:59 -04:00
Niko Matsakis
e1920bdda6 require databases and ingredients to be static 2024-07-06 08:15:27 -04:00
Noah Lev
c4af8d01e1 Impl Update for unit type ()
This is useful in code that uses typestate.
2024-06-24 19:27:26 -07:00
Niko Matsakis
4eaa4efdc5
Merge pull request #505 from mbrobbel/issue-504-deps
Remove some unused dependencies
2024-06-23 10:06:10 +00:00
Jack Rickard
db4c0de45c
Implement Update for Option<T> 2024-06-21 14:37:12 +01:00
Niko Matsakis
7c36154b36 drive by fix for some clippy warnings 2024-06-19 05:59:58 -04:00
Niko Matsakis
2abdd3f2d5 implement Update trait for sets/maps 2024-06-19 05:59:58 -04:00
Matthijs Brobbel
38070130a8
Remove some unused dependencies 2024-06-19 11:55:18 +02:00
Matthijs Brobbel
c7851112a5
Rename salsa-2022 to salsa 2024-06-18 09:40:21 +02:00
Matthijs Brobbel
db75ae00a2
Remove old salsa 2024-06-18 09:25:26 +02:00
Niko Matsakis
0ad0be8095 pacify the merciless clippy 2024-05-30 08:40:18 -04:00
Niko Matsakis
e81b22315b driveby: fix use of indexmap remove
We do care about the order of things in this
set, in general, so use `shift_remove`.
2024-04-02 06:30:53 -04:00
bors[bot]
5c63715a95
Merge #381
381: fix typos r=nikomatsakis a=Aadamandersson



Co-authored-by: Adam Andersson <adam.m.andersson@gmail.com>
2022-08-25 10:34:44 +00:00
Adam Andersson
18507f2ff7 fix some typos 2022-08-24 21:12:58 +02:00
andrzej.gluszak
73102b1e8e Fix clippy issues 2022-08-24 18:45:53 +02:00
Niko Matsakis
95812f09d0 cargo fmt 2022-06-03 07:01:27 -04:00
Niko Matsakis
f91923c189 switch to Option<StampedValue> for efficiency 2022-06-03 06:44:16 -04:00
Niko Matsakis
1cc649b5e4 store an Option to fix tests 2022-06-03 06:24:50 -04:00
Niko Matsakis
1e3c2f22aa Expose the ability to remove the value from an input query, taking ownership of it
Co-authored-by: Tim Robinson <tim.g.robinson@gmail.com>
2022-06-03 05:52:00 -04:00
Niko Matsakis
f0231fb884 remove unused memo function 2022-03-14 18:35:33 -04:00
Niko Matsakis
e5fb61b367 when evicting LRU data, keep dep information
and add a test that we do so!
2022-03-14 18:27:44 -04:00
Niko Matsakis
37a188c9b7 remove dead struct 2022-01-21 14:16:14 -05:00
Niko Matsakis
ade6bcf2b1 check for cancellation more aggressively 2022-01-21 13:58:15 -05:00
Niko Matsakis
356392578b new parallel friendly algorithm 2022-01-21 13:58:13 -05:00
Niko Matsakis
685fccc9c5 move to dash-map
Because dash-map isn't indexable, we need to store a copy of the
key and have two separate maps. I expect to iterate on the best
data structures here.
2022-01-21 13:56:16 -05:00
Niko Matsakis
c0d9070a64 refactor _mut path to not take arc
Instead of grabbing the arc, just pass back an `&mut Runtime`.

The eventual goal is to get rid of the lock on the `set` pathway
altogether, but one step at a time.
2022-01-21 13:52:43 -05:00
Niko Matsakis
82d695b9a7 extract hashing definitions into a utility module 2022-01-21 13:49:50 -05:00
bors[bot]
2709ee4d10
Merge #288 #289
288: Make with_incremented_revision take FnOnce r=nikomatsakis a=mheiber

Removes a bug vector, since this function would
panic if the closure is used more than once.

iuc, the code opted out of the compiler's checks
before via a clever `.take()`.

Another change is to take the closure by value
rather than by reference. The monomorphization
seems harmless, since `with_incremented_revision`
is only called from two places.

289: Remove ': salsa::Database' bound from two examples r=nikomatsakis a=mheiber

Two examples had a superfluous bound
': salsa::Database' that wasn't present
in the `compiler` example and doesn't seem to be needed.

The `query_group` macro adds this bound
automatically.

This change can lead to a trailing `+` in
the bounds list. I verified this is OK by
running the examples and verifying that the production
is allowed
[per the Rust Reference](https://doc.rust-lang.org/reference/trait-bounds.html)

Co-authored-by: Maxwell Elliot Heiber <mheiber@fb.com>
2022-01-21 18:35:51 +00:00
Maxwell Elliot Heiber
befa3ddef5 Make with_incremented_revision take FnOnce
The function is morally an FnOnce, since if
called multiple times the function will panic.

iuc, the code opted out of the compiler's checks
before via a clever `.take()`.

Another change is to take the closure by value
rather than by reference. The monomorphization
seems harmless, since `with_incremented_revision`
is only called from two places.
2021-12-30 10:44:35 +00:00
Niko Matsakis
fc020de9c4 s/maybe_changed_since/maybe_changed_after/ 2021-11-13 16:39:41 -05:00
Niko Matsakis
cd265bfd12
Update src/runtime/dependency_graph.rs
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-11-13 16:28:59 -05:00
Niko Matsakis
563334da17 fix comments 2021-11-13 12:02:25 -05:00
Niko Matsakis
5ebd2211a5 don't recover when not a participant
When a query Q invokes a cycle Q1...Q1 but Q is not a
participant in that cycle, Q should not recover! Test that.
2021-11-12 05:50:06 -05:00
Niko Matsakis
cb658b9b89 enable partial recovery across threads
Including the corner case where the active thread does not have
recovery.
2021-11-11 09:07:45 -05:00
Niko Matsakis
93ee78e73f factor out a helper to unblock a given runtime 2021-11-11 06:54:52 -05:00
Niko Matsakis
92b5c0261b introduce a condvar per thread, instead of one
The previous version had a lot of spurious wakeups, but it
also resisted the refactoring I'm about to do. =)
2021-11-11 06:54:52 -05:00
Niko Matsakis
45434cfa93 rework cycle to permit partial recovery (wip)
This is "wip" because it does not yet handle cross-thread recovery
correctly. That is coming in a later commit.
2021-11-11 06:54:32 -05:00
Niko Matsakis
c14a3d47ea remove memo from PanicGuard
`PanicGuard` used to own the memo so that, in the case of panic,
we could reinstall the old value -- but there's no reason for us to
do that. It's just as good to clear the slot in that case and recompute
it later. Also, it makes the code nicer to remove it, since
it allows us to have more precision about where we know the memo is
not null.

My motivation though is to work towards "partial cycle recovery".
We need a clean and easy way to cancel the ongoing execution and reset
the slot to "not computed" (turns out we used that in
`maybe_changed_since` too!).
2021-11-10 21:01:00 -05:00
Niko Matsakis
961599aa39 unwind from "block on" for panic/cancellation
We still record the same dependencies (or else the tests fail,
so +1 for test coverage).

This has the immediate advantage that we don't invoke the fallback
function twice for the repeated node in the cycle.

Also, fix a bug where revalidating cycles could lead to a
CycleParticipant error that is not caught (added a test for it).
2021-11-08 08:07:45 -05:00
Niko Matsakis
b9d748a2ae move content from rfc into book,d ocs 2021-11-06 05:29:31 -04:00
Niko Matsakis
7d66224319 start expanding the book (wip!) 2021-11-03 10:53:39 -04:00
Niko Matsakis
33d47cc747 throw Cycle value directly
Do not wrap in Cancelled.
2021-11-02 12:45:42 -04:00
Niko Matsakis
62e2fabab9 on fallback, get deps from all cycle participants
We used to store a changed-at/durability that reflected only
the current frame in a cycle -- but really we are dependent
across the entire cycle, so we now store the max changed-at and
min durability from the entire thing.
2021-11-02 06:18:58 -04:00
Niko Matsakis
7dbacbcf2b rotate the participants in the cycle once
Rotate the participants in the cycle when the cycle is created
rather than doing it "on the fly" each time they are iterated.
2021-11-02 06:13:18 -04:00
Niko Matsakis
187de0f280 rename fn: query may be in same thread 2021-11-02 06:13:18 -04:00
Niko Matsakis
006848a8cc matklad nikomatsakis 2021-11-02 06:13:18 -04:00
Niko Matsakis
83b2f40ca2 apply cargo fmt 2021-11-02 05:06:26 -04:00
Niko Matsakis
c096f714b5 fix clippy warnings 2021-11-01 13:42:03 -04:00
Niko Matsakis
3f95c0b4a0 panic when recovering from a cycle
It turns out this is necessary, as this test reveals!
If we don't panic, you might encounter further cycles
that aren't supposed to have executed. (Prior to these changes,
this test was panicking from the second cycle.)
2021-11-01 10:10:50 -04:00
Niko Matsakis
1027342468 introduce QueryRevisions and use everywhere
`QueryRevisions` is a shared struct that contains
"everything a query read thus far" -- it is roughly
the old `MemoRevisions` but without `verified_at`.

This change is useful because when a cycle occurs it
allows us to isolate out "inputs thus far" more easily.
2021-11-01 06:10:07 -04:00
Niko Matsakis
891a866653 refactor Memo to just be parameterized over V 2021-10-31 09:47:15 -04:00
Niko Matsakis
75ee3edd2e introduce Cycle type and use in recovery, errors
The Cycle type gives more structured information and ensures
deterministic ordering of participants within any particular
execution.
2021-10-31 07:21:07 -04:00
Niko Matsakis
3caf965533 limit visibility of CycleError 2021-10-31 06:41:05 -04:00
Niko Matsakis
61599cc81a report unexpected cycles using Cancelled
The `Cancelled` struct now reflects multiple potential reasons
for a query execution to be cancelled, including unexpected cycles.
It also gives information about the participants that lacked
recovery information.
2021-10-31 06:18:50 -04:00
Niko Matsakis
4a1dffe7bc cleanup: move cycle recovery into try_block_on
This is just a refactoring.
2021-10-31 05:39:15 -04:00
Niko Matsakis
5fe48246a9 take take take, that's all you do 2021-10-31 04:14:55 -04:00
Niko Matsakis
cb00077ebc silence clippy warnings
cargo clippy --fix ftw
2021-10-30 17:20:32 -04:00