304: entity-based salsa preview r=nikomatsakis a=nikomatsakis
This PR is a squashed and updated version of my entity branch. This API is, I believe, what will become the long awaited (by me, anyway) Salsa 1.0 release. It's a complete overhaul of the Salsa API and implementation that feels a lot cleaner to me.
The PR includes a tutorial and sample application (a compiler) that covers the major concepts. There is still more work needed to complete the tutorial and in particular to write up a bunch of tests (I had more tests but they were hacky so I deleted them).
Right now, all the new stuff is in a pair of new crates, salsa-entity-mock and salsa-entity-macros, leaving the existing salsa intact. I would like to remove the old salsa but we have to reconcile the two and port over the tests.
There is still a fair bit of work to do before we can release this new version of Salsa, but I expect a lot of it can happen after this PR is merged. The list is on #305.
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
303: Bump parking_lot packages r=jonas-schievink a=eliascodes
This is motivated by recent changes to `parking_lot` affecting `wasm32-unknown-unknown` targets (see https://github.com/Amanieu/parking_lot/issues/269 if interested). My project depends on `parking_lot` via `salsa`, which is why I'm facing this issue.
TLDR is that `parking_lot` released a new version that provides a fix for the above. I'm hoping that version can be included in a future version of `salsa`.
For reference, here's the relevant part of the changelog: https://github.com/Amanieu/parking_lot/blob/HEAD/CHANGELOG.md#parking_lot-0120-parking_lot_core-090-lock_api-046-2022-01-28
I belive the only changes that might affect APIs used by `salsa` are in PRs https://github.com/Amanieu/parking_lot/pull/313 and https://github.com/Amanieu/parking_lot/pull/344/files, but I'm unfamiliar with the internals of either project so could easily be wrong.
I can build and test successfully locally with these bumps. Let me know if there's anything else I can do to help this over the line.
Co-authored-by: Elias Malik <elias0789@gmail.com>
275: Expose the ability to remove the value from an input query, taking ownership of the value r=nikomatsakis a=1tgr
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
302: fix misleading type in salsa book example r=nikomatsakis a=LYF1999
fix misleading type in salsa book example
Co-authored-by: Yifei <lyfmagic99@gmail.com>
298: when evicting LRU data, keep dep information r=nikomatsakis a=nikomatsakis
and add a test that we do so!
cc `@Veykril` -- this should fix Rust-Analyzer performance
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
292: Document how to tune Salsa r=nikomatsakis a=mheiber
Document how to tune Salsa
> Re the CI failure: I couldn't repro locally with the same command. On CI, mdbook complains it can't find `./rfcs/RFC0007-Opinionated-cancelation.md`
Co-authored-by: Maxwell Elliot Heiber <mheiber@fb.com>
297: Fix netlify deployment r=nikomatsakis a=nikomatsakis
I think I just configured this in a pretty bogus way
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
296: Slot no more: overhauled internal algorithm r=nikomatsakis a=nikomatsakis
This is the overhauled implementation that avoids slots, is more parallel friendly, and paves the way to fixed point and more expressive cycle handling.
We just spent 90 minutes going over it. [Some rough notes are available here,](https://hackmd.io/6x9f6mavTRS2imfG96tP5A) and a video will be posted soon.
You may find the [flowgraph useful](https://raw.githubusercontent.com/nikomatsakis/salsa/slot-no-more/book/src/derived-query-read.drawio.svg).
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
294: Fix mdbook warning re "Potential incomplete link" r=nikomatsakis a=mheiber
In cycle.md, change `[salsa::Cycle]` to `salsa::Cycle` so mdbook doesn't get confused
and think there is a broken Markdown link ("warning: Potential incomplete link").
After fixing this problem, there are no more mdbook warnings when
running `mdbook build` in the "book" directory.
Co-authored-by: Maxwell Elliot Heiber <mheiber@fb.com>
295: Make storage fields of #nameGroupStorage private r=nikomatsakis a=mheiber
This change resolves a fixme that referenced #120.
This change breaks no tests, and, if I understand
correctly, does not affect user-facing API.
Here is the difference for the `HelloWorldGroupStorage__` struct
generated from macros in the `hello_world` example:
**Before:**
```rs
struct HelloWorldGroupStorage__ {
pub input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,pub length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```
**After:**
```rs
struct HelloWorldGroupStorage__ {
input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```
Co-authored-by: Maxwell Elliot Heiber <mheiber@fb.com>
This change resolves a fixme that referenced #120.
This change breaks no tests, and, if I understand
correctly, does not affect user-facing API.
Here is the difference for the `HelloWorldGroupStorage__` struct
generated from macros in the `hello_world` example:
**Before:**
```rs
struct HelloWorldGroupStorage__ {
pub input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,pub length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```
**After:**
```rs
struct HelloWorldGroupStorage__ {
input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```
In cycle.md, change `[salsa::Cycle]`
to `salsa::Cycle` so mdbook doesn't get confused
and think there is a broken Markdown link.
The warning was as follows:
```
warning: Potential incomplete link
┌─ cycles.md:3:131
│
3 │ By default, when Salsa detects a cycle in the computation graph, Salsa will panic with a [`salsa::Cycle`] as the panic value. The [`salsa::Cycle`] structure that describes the cycle, which can be useful for diagnosing what went wrong.
│ ^^^^^^^^^^^^^^^^ Did you forget to define a URL for ``salsa::Cycle``?
│
= hint: declare the link's URL. For example: `[`salsa::Cycle`]: http://example.com/`
```
After fixing this problem, there are no more mdbook warnings.
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.