Commit graph

278 commits

Author SHA1 Message Date
Niko Matsakis
ad61687e83 wip 2024-07-19 08:09:55 -04:00
Niko Matsakis
68a3a7fceb wip 2024-07-19 08:05:39 -04:00
Niko Matsakis
6377dbadb8 wip 2024-07-19 07:29:18 -04:00
Niko Matsakis
73a6aed554 wip privacy on interned 2024-07-19 07:14:57 -04:00
Niko Matsakis
fe90e68c8f wip privacy for tracked structs 2024-07-19 07:12:07 -04:00
Niko Matsakis
3304acc5dd wip: accum, privacy for inputs 2024-07-19 07:08:24 -04:00
Niko Matsakis
82a1e59e46 update expect tests 2024-07-19 06:24:51 -04:00
Niko Matsakis
b677019407 fix accumulation 2024-07-19 06:22:40 -04:00
Niko Matsakis
5209735d0b ensure the fn value is up-to-date 2024-07-19 06:00:16 -04:00
Niko Matsakis
92eee06596 delete a bunch of dead code 2024-07-19 05:55:40 -04:00
Niko Matsakis
812923ab0c wip 2024-07-18 07:49:06 -04:00
Niko Matsakis
6e22d6ec42 wip 2024-07-18 06:33:21 -04:00
Niko Matsakis
efbf3249ef wip 2024-07-18 06:32:18 -04:00
Niko Matsakis
82872192b4 return_ref on tracked fn 2024-07-18 06:13:57 -04:00
Niko Matsakis
b7e6bc62af make methods work 2024-07-18 06:03:34 -04:00
Niko Matsakis
043922d34f wip 2024-07-17 09:18:43 -04:00
Niko Matsakis
585b720fff wip 2024-07-17 09:14:20 -04:00
Niko Matsakis
b08015e639 wip 2024-07-17 08:56:08 -04:00
Niko Matsakis
e9c0607816 wip 2024-07-17 08:50:04 -04:00
Niko Matsakis
8f8528a205 wip 2024-07-17 08:45:49 -04:00
Niko Matsakis
2213729c4e wip 2024-07-17 08:42:06 -04:00
Niko Matsakis
4e295f2257 wip 2024-07-17 07:49:46 -04:00
Niko Matsakis
c9426d2e4f wip 2024-07-17 06:54:24 -04:00
Niko Matsakis
185c86bb5a wip 2024-07-17 06:51:50 -04:00
Niko Matsakis
7443277381 wip 2024-07-17 06:41:56 -04:00
Niko Matsakis
afd7bcfa78 wip 2024-07-17 06:14:43 -04:00
Niko Matsakis
b552852f29 wip 2024-07-17 06:08:34 -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
a0bdff5af7 wip 2024-07-16 06:05:20 -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
a4e550065f autogenerate interned case 2024-07-13 07:01:31 -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
d666744704 manually expanded code 2024-07-12 07:51:33 -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
e1920bdda6 require databases and ingredients to be static 2024-07-06 08:15:27 -04:00
Matthijs Brobbel
396c4a4073
Also remove env_logger 2024-06-20 17:03:02 +02:00
Matthijs Brobbel
0f2d5a516c
More book updates and a compile fail test fix 2024-06-18 10:03:53 +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
afd9b72203 pacify the merciless clippy 2024-04-02 06:51:39 -04:00
andrzej.gluszak
73102b1e8e Fix clippy issues 2022-08-24 18:45:53 +02:00
Bernardo Uriarte
927d905e58 test-env-log has been renamed to test-log 2022-08-22 11:00:47 +02:00
Niko Matsakis
26e099eb12 broken tests 2022-06-03 06:08:57 -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
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
356392578b new parallel friendly algorithm 2022-01-21 13:58:13 -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
bfa74bc865 spread parallel tests into their own files
I was finding the parallel test setup hard to read,
so everything relating to one test is now in a single
file, with shorter names.
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
33d47cc747 throw Cycle value directly
Do not wrap in Cancelled.
2021-11-02 12:45:42 -04:00
Niko Matsakis
eb307e4868 rename and incorporate new test 2021-11-02 06:23:48 -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
1011274c9c repeat test configuration
The default made tests harder to read.
2021-11-02 06:13:18 -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
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
ea6eedd9a3 test cycles with mixed recovery 2021-10-31 06:35:55 -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
d8a792ce60 use RefCell::take 2021-10-31 04:13:42 -04:00
Niko Matsakis
cb00077ebc silence clippy warnings
cargo clippy --fix ftw
2021-10-30 17:20:32 -04:00
Niko Matsakis
a53b1c53f1 put queries on the stack when validating 2021-10-30 11:46:37 -04:00
Niko Matsakis
293e103c09 make "maybe changed since" share code with read
It is still *slightly* different from `read`.
This seems to have fixed various bugs.
2021-10-30 11:45:12 -04:00
Niko Matsakis
0630fb1139 track caller to give better line numbers on test errors 2021-10-30 11:38:29 -04:00
Niko Matsakis
da188fe609 extract DependencyGraph into its own module 2021-10-30 11:30:12 -04:00
Niko Matsakis
2d7a84b4f4 silence lint 2021-10-30 11:27:04 -04:00
Niko Matsakis
79f8acc3aa improve parallel cycle tests
Before we could not observe the case where:

* thread A is blocked on B
* cycle detected in thread B
* some participants are on thread A and have to be marked

(In particular, I commented out some code that seemed necessary and
didn't see any tests fail)
2021-10-30 11:27:04 -04:00
Niko Matsakis
7b9c383eb0 improve parallel cycle tests
They now use signals to guarantee we are testing the code paths
we want to be testing.
2021-10-30 11:15:08 -04:00
Niko Matsakis
b4a04531a9 document what we are testing, rename variables 2021-10-30 11:10:10 -04:00
Niko Matsakis
40139abc24 enable debug logging in the cycles tests 2021-10-30 11:09:08 -04:00
Niko Matsakis
b72b251240 add should-panic annotations to cycle tests that fail 2021-10-30 11:09:08 -04:00
Aleksey Kladov
0f3bc72ec0 Add tests for "dynamic" cycles
If I am not in an error, all current tests uses "static" cycles -- a
cycle always present. Let's spice that up by adding conditional cycles:
cycles that appear only for specific impls
2021-10-30 11:09:05 -04:00
Florian Diebold
ae8348c4f1 Add failing test for cycle revalidation 2021-10-30 11:07:40 -04:00
Jonas Schievink
8f0b9b7f82 Fix invalidate and report_synthetic_read 2021-09-03 23:35:15 +02:00
Tim Robinson
fc6806a07c CI runs Clippy 2021-06-17 15:21:51 +01:00
Niko Matsakis
f7dd6b3219 remove tracing garbage collection support
It is not widely used and it makes it harder to evolve Salsa.
2021-06-06 06:06:03 -04:00
Jonas Schievink
458266e1cd Move unwind_if_cancelled to Database 2021-05-25 15:34:57 +02:00
Jonas Schievink
1fb660c33e Use the more common spelling of cancell{ed,ation} 2021-05-25 15:08:23 +02:00
Jonas Schievink
f9cb032568 Fix "frozen" test 2021-05-25 14:55:38 +02:00
Jonas Schievink
223f87bb18 Canonicalize to US spelling of "cancelation" 2021-05-18 15:36:43 +02:00
Jonas Schievink
49a1184bcf Improve Canceled API 2021-05-18 14:41:45 +02:00
Jonas Schievink
197b01fa4b Implement "opinionated cancellation" 2021-05-17 18:59:28 +02:00
Niko Matsakis
fad97eeb6a remove the DB parameter
This had two unexpected consequences, one unfortunate, one "medium":

* All `salsa::Database` must be `'static`. This falls out from
`Q::DynDb` not having access to any lifetimes, but also the defaulting
rules for `dyn QueryGroup` that make it `dyn QueryGroup + 'static`. We
don't really support generic databases anyway yet so this isn't a big
deal, and we can add workarounds later (ideally via GATs).

* It is now statically impossible to invoke `snapshot` from a query,
and so we don't need to test that it panics. This is because the
signature of `snapshot` returns a `Snapshot<Self>` and that is not
accessible to a `dyn QueryGroup` type. Similarly, invoking
`Runtime::snapshot` directly is not possible becaues it is
crate-private. So I removed the test. This seems ok, but eventually I
would like to expose ways for queries to do parallel
execution (matklad and I had talked about a "speculation" primitive
for enabling that).

* This commit is 99% boilerplate I did with search-and-replace. I also
rolled in a few other changes I might have preferred to factor out,
most notably removing the `GetQueryTable` plumbing trait in favor of
free-methods, but it was awkward to factor them out and get all the
generics right (so much simpler in this version).
2020-07-04 14:17:11 +00:00
Niko Matsakis
0e5366df5d move to QueryType.in_db(&db) instead of db.query(QueryType)
This will be more compatible once we move to having queries have an
associated `DynDb` type. It also reads nicely.
2020-07-04 14:17:11 +00:00
Niko Matsakis
12f54d66f4 move query/query-mut to DatabaseQueryExt 2020-07-04 14:17:11 +00:00
Niko Matsakis
d1fe9950c5 simplify salsa_event and make it dyn-safe 2020-07-04 14:17:11 +00:00
Niko Matsakis
67687376ed implement the Storage<DB> change 2020-07-04 14:17:10 +00:00
Niko Matsakis
b3ffaec3b0 remove salsa::requires feature 2020-07-04 14:16:50 +00:00
Niko Matsakis
1b778760ae track and report cycles using DatabaseKeyIndex 2020-07-04 14:16:50 +00:00
Niko Matsakis
8c133e7a4d make synthetic_write require &mut self (breaking change!)
This was an oversight before -- the current type implies that
one introduce a synthetic write (and hence a new revision) from
a `Frozen<DB>`! Not cool.
2019-09-27 05:50:16 -04:00
Niko Matsakis
b9f00726da introduce Database::salsa_runtime_mut method (breaking change!) 2019-09-27 05:49:15 -04:00
Aleksey Kladov
ec5b92ea20 tests and docs for on-demand input pattern 2019-09-20 12:25:12 +03:00