Commit graph

283 commits

Author SHA1 Message Date
Niko Matsakis
86dfdd1fda permits things to become *more* durable without a "change"
This will be important if we want to automatically upgrade the
durability of inputs.
2019-07-02 07:49:01 -04:00
Niko Matsakis
5bbd500c64 switch internally from IsConstant to Durability 2019-07-02 07:49:01 -04:00
Niko Matsakis
21a70b6eb0 use a newtype'd IsConstant for better readability
Random bool constants are just so gauche.
2019-07-02 07:49:01 -04:00
Niko Matsakis
e480e08013 simplify slot constant tracking 2019-07-02 07:49:01 -04:00
Niko Matsakis
30714022fd kill the ChangedAt struct
It didn't seem like it was buying us much.
2019-07-02 07:49:01 -04:00
Niko Matsakis
0a5b6b0451 permit constants to be modified
We now track the last revision in which constants were modified. When
we see a constant query result, we record the current revision as
well. Then later we can check if the result is "still" constant. This
lets us cut out a lot of intermediate work.
2019-07-02 07:49:01 -04:00
Niko Matsakis
ed2bd527e8 use a fixed seed 2019-07-02 06:49:24 -04:00
Niko Matsakis
7bd9e0120f use a proper standard deviation to compare oracle + approx LRU 2019-07-02 06:49:24 -04:00
Niko Matsakis
2750830694 remove outdated comment 2019-07-02 06:49:24 -04:00
Niko Matsakis
e7d704dd8b convert DatabaseSlot to unsafe trait
The unsafe impl now asserts that the `DatabaseSlot` implementor type
is indeed `Send+Sync` if `DB::DatabaseData` is `Send+Sync`. Since our
query keys/values are a part of database-data, this means that `Slot`
must be `Send+Sync` if the key/value are `Send+Sync`. We test this
with a function that will cause compliation to fail if we accidentally
introduce an `Rc<T>` etc.
2019-07-02 06:49:24 -04:00
Niko Matsakis
579e093213 generate a DatabaseData tuple that collects all the key, values 2019-07-02 06:49:24 -04:00
Niko Matsakis
3224c322e8 switch to a NonZeroU64 so that Option<Revision> is one word 2019-07-02 06:49:24 -04:00
Niko Matsakis
4f8c4720d4 change Revision to start from 1 2019-07-02 06:49:24 -04:00
Niko Matsakis
9d550a9343 track dependencies via direct links to slots 2019-07-02 06:49:24 -04:00
Niko Matsakis
50cb001b41 introduce slots to the interner 2019-07-02 06:49:24 -04:00
Niko Matsakis
85848e1bbf complete mysterious comments 2019-07-02 06:49:24 -04:00
Niko Matsakis
11aba6ad2b introduce slots to input storage 2019-07-02 06:49:24 -04:00
Niko Matsakis
03e64254e9 do not store database_key in the slot 2019-07-02 06:49:24 -04:00
Niko Matsakis
7988b5e295 switch to the "random LRU" strategy 2019-07-02 06:49:22 -04:00
Niko Matsakis
d80b3dd879 integrate lru logic into derived table 2019-07-02 06:49:02 -04:00
Niko Matsakis
e9f91f03a5 roll our own lru list
We could use e.g. intrusive-collections but from reading the docs and
surveying the source it wasn't *obvious* to me that it had the right
semantics.
2019-07-02 06:48:59 -04:00
Niko Matsakis
4e5a23b9d7 rewrite derived table to use Slot (LRU not yet supported) 2019-07-02 06:48:32 -04:00
Aleksey Kladov
caa8dcfb06
Update src/runtime.rs
Co-Authored-By: Niko Matsakis <niko@alum.mit.edu>
2019-06-26 13:28:12 +03:00
Aleksey Kladov
6d60798eb8 Replace volatile query type with report_untracked_read fn 2019-06-26 13:10:44 +03:00
Niko Matsakis
efa4696ab7
Merge pull request #171 from matklad/lru
Add LRU to derived storage
2019-06-12 05:43:46 -04:00
Aleksey Kladov
88fed8d6d6 Fix correctness bug when LRU evicted volatile query 2019-06-11 12:59:53 +03:00
Aleksey Kladov
7660277d8e switch to atomic usize 2019-06-10 10:54:17 +03:00
Aleksey Kladov
0827c88259 use single lock for LRU 2019-06-09 16:47:51 +03:00
Aleksey Kladov
3d89c0d817 Add LRU to derived storage
LRU allows to bound the maximum number of *values* that are present in
the table.
2019-06-07 14:26:21 +03:00
Aleksey Kladov
fcc7058e9c implement strong panic safety
Previosly, panicking query would remove in-progress memos from the
table.

However, we use panic for cancellation, so it's reasonable to **not**
remove the old result after panic. This is also known as string
exception safety guarantee: not only database is in *some* consistent
state after a panic, it is in the same state it was before the panic!
2019-06-01 23:19:15 +03:00
Niko Matsakis
74294f71f3 s/RawId/InternId/ 2019-04-03 11:01:20 -03:00
Niko Matsakis
40d0c8d21a
Merge pull request #157 from nikomatsakis/raw-id
adopt raw-id for interned keys
2019-03-31 07:53:38 -03:00
Niko Matsakis
4402338908 Revert "do not expose that RawId is stored in a u32"
This reverts commit 9b106e9279.
2019-03-31 07:34:10 -03:00
Niko Matsakis
d6934ac247 adopt NonZeroU32 2019-03-31 06:49:41 -03:00
Niko Matsakis
9b106e9279 do not expose that RawId is stored in a u32 2019-03-31 06:46:29 -03:00
Niko Matsakis
da1b26a52e adopt raw-id 2019-03-30 06:43:16 -03:00
Niko Matsakis
5e84531d7b
Merge pull request #153 from regexident/send
Removed remaining stray bounds for `Send + Sync` that still survived PR #42
2019-03-29 08:24:05 -04:00
Aleksey Kladov
9d6236bc79 make sure interned state is send 2019-03-27 14:33:59 +03:00
Vincent Esche
0696ed8c3b Removed yet another pair of stray bounds for Send + Sync. This time on keys 2019-03-27 10:44:28 +01:00
Vincent Esche
5aa0455950 Removed remaining stray bounds for Send + Sync that still survived PR #42 2019-03-26 16:21:23 +01:00
Niko Matsakis
c040b0c673 fix gc and volatile tests 2019-03-22 16:24:37 -04:00
Niko Matsakis
c5795a3e5c only GC outdated intern keys 2019-03-22 05:13:07 -04:00
Niko Matsakis
9689d4471b revert take_while changes, which were just .. wrong 2019-03-22 04:58:47 -04:00
Niko Matsakis
c8b30c52e1 nit: change filter to take_while to make clear we stop early
i.e., we never proceed after we find *something* that is dirty.
2019-03-13 05:30:03 -04:00
Niko Matsakis
7d5d01104c document the logic from a FIXME and improve panics 2019-03-13 05:27:14 -04:00
Niko Matsakis
7dcdad88e3 convert to <= when comparing against std::u32::MAX 2019-03-13 05:18:35 -04:00
Niko Matsakis
7ed24f0fa3 use InternIndex also to represent indices from the user 2019-03-13 05:18:35 -04:00
Niko Matsakis
71f250d037 WIP fix DiscardIf::Always, thanks matklad :) 2019-03-12 09:26:46 -04:00
Niko Matsakis
f48515747c create a true inverse key for the lookup path 2019-03-12 08:55:37 -04:00
Niko Matsakis
56ef78109a remove send/sync bounds 2019-02-04 22:10:05 +01:00