Commit graph

1122 commits

Author SHA1 Message Date
Niko Matsakis
1c882bb598 fix missing format! calls in entity_like.rs 2022-08-03 00:31:26 -04:00
Niko Matsakis
196baab60d add InputIngredient
They are a very simple variant on entities
2022-08-03 00:30:52 -04:00
Niko Matsakis
d134e0a54b comment the fields on an interned ingredient 2022-08-03 00:05:37 -04:00
Niko Matsakis
3559ac2b21 remove trailing whitespace 2022-08-02 15:05:28 -04:00
Niko Matsakis
548beade54 extract configuration struct/impl code from entity
`#[salsa::input]` structs will need similar code
2022-08-02 10:56:27 -04:00
Niko Matsakis
f2649ee503 extract helper functions for validation 2022-08-02 14:22:45 +03:00
Niko Matsakis
db75a1a510 write up a new API proposal, tracked 2022-08-02 10:24:38 +03:00
Niko Matsakis
8e348f0bc8 clarify jars a bit, hopefully
Some folks were thinking that Jars were something
more complex than they are.
2022-08-02 07:57:23 +03:00
bors[bot]
6bd6f6ee0b
Merge #307
307: quick fix for components w/ optional jar r=nikomatsakis a=nikomatsakis

We need tests!

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-08-02 04:32:17 +00:00
Niko Matsakis
d0b7046245 quick fix for components w/ optional jar
We need tests!
2022-08-02 07:28:13 +03:00
bors[bot]
9eed580f51
Merge #304
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>
2022-08-02 03:51:35 +00:00
Niko Matsakis
5aabd4014d add a caveat to avoid confusion 2022-08-02 06:37:12 +03:00
Niko Matsakis
e3769b5c31 remove trailing whitespace
this seems to be a rustfmt bug?
2022-08-01 13:54:21 +03:00
Niko Matsakis
985650523e entity-based salsa preview 2022-08-01 09:24:49 +03:00
bors[bot]
754eea8b5f
Merge #303
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>
2022-07-06 14:38:59 +00:00
Elias Malik
81b798470e bump parking_lot packages 2022-06-07 13:39:07 +01:00
bors[bot]
cf22135ec2
Merge #275
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>
2022-06-03 11:06:53 +00: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
b7ac12758b update RFC 2022-06-03 06:28:23 -04:00
Niko Matsakis
1cc649b5e4 store an Option to fix tests 2022-06-03 06:24:50 -04:00
Niko Matsakis
26e099eb12 broken tests 2022-06-03 06:08:57 -04:00
Niko Matsakis
1f561023cd draft RFC 2022-06-03 06:08:52 -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
bors[bot]
887f24c06d
Merge #302
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>
2022-05-31 13:17:55 +00:00
Yifei
9abfe4f9de fix misleading type 2022-05-31 09:14:32 +00:00
Niko Matsakis
ae4960e1f0
add the logo 2022-04-15 10:14:50 -04:00
bors[bot]
b4fed3df0d
Merge #298
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>
2022-03-15 13:30:52 +00: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
bors[bot]
51788fb513
Merge #292
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>
2022-02-14 15:04:48 +00:00
Maxwell Elliot Heiber
7fba34afd9 Document how to tune Salsa 2022-02-12 10:34:11 +00:00
bors[bot]
f4e09fee23
Merge #297
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>
2022-02-07 20:50:03 +00:00
Niko Matsakis
796ca0fd27 move to book directory 2022-02-07 15:44:29 -05:00
Niko Matsakis
2ff73b9ae5 trace commands 2022-02-07 15:41:50 -05:00
Niko Matsakis
3bdc61f9d8 add ci/netlify.sh 2022-02-07 15:38:51 -05:00
bors[bot]
0f9971ad94
Merge #296
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>
2022-02-07 20:30:07 +00:00
bors[bot]
d294be791e
Merge #294
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>
2022-01-25 19:57:44 +00:00
bors[bot]
73aba192c1
Merge #295
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>
2022-01-25 19:54:56 +00:00
Maxwell Elliot Heiber
a1be30bc13 Make storage fields of #nameGroupStorage private
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> ,
}
```
2022-01-23 20:18:25 +00:00
Maxwell Elliot Heiber
d80d10d0c4 Fix mdbook warning re "Potential incomplete link"
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.
2022-01-23 19:55:02 +00:00
Niko Matsakis
d4a6b24358 Update derived-query-maybe-changed-after.drawio.svg 2022-01-21 15:14:10 -05:00
Niko Matsakis
416884bdfa Update derived-query-maybe-changed-after.drawio.svg 2022-01-21 15:14:04 -05:00
Niko Matsakis
ff5c6137ac Update derived-query-maybe-changed-after.drawio.svg 2022-01-21 15:12:01 -05:00
Niko Matsakis
d69bddea9e Update derived-query-maybe-changed-after.drawio.svg 2022-01-21 15:06:47 -05:00
Niko Matsakis
be7a6ed06c Added derived-query-maybe-changed-after.drawio.svg 2022-01-21 14:58:26 -05:00
Niko Matsakis
b3242064a2 Update derived-query-read.drawio.svg to indicate fn boundaries 2022-01-21 14:55:46 -05: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
2e0301f043 "maybe changed AFTER" in diagram 2022-01-21 13:58:15 -05:00