Comments (2)
@enomado I believe the panic is the expected behavior of Salsa, as mentioned in issue #407. The issue lies in the code p.md(&db)
within the loop, which continues to use a tracked struct after altering the inputs using a.set_md(&mut db).to(vec![i as f64])
. To fix this, you should call m_merge
again to get the newest tracked struct.
let a = MyVal::new(&db, vec![1.0]);
let b = MyVal::new(&db, vec![2.0]);
let p = m_merge(&db, a, b);
for i in 0..10 {
a.set_md(&mut db).to(vec![i as f64]);
let p = m_merge(&db, a, b);
dbg!(p.md(&db));
}
However, I think that the error message needs improvement to avoid confusion. A panic message like "accessing a field of a tracked struct MyVal
from an older revision" would be better.
from salsa.
@xffxff thanks! I thought tracked structure can store whole computation chain at its own. I think it must be covered in documentation. just like
dont expect tracked struct can recalculate itself without calling whole chain
it could clarify a lot :)
Btw, please, tell where I wrong. I want generalize input structs and tracked structs
from salsa.
Related Issues (20)
- Support rayon-like parallel execution
- Test with loom (or shuttle) and/or fuzz testing
- Revise approach to interning HOT 1
- Support results with internal references
- Update book to clarify this is not what is on crates.io
- Why do we use eyre crate?
- README links to a "Hello, World" example that does not exist
- Please make a release HOT 2
- inconsistent behavior with respect to lifetime elision
- re-enable cargo miri HOT 4
- no_eq HOT 2
- Unexpected panic: `assertion 'left= right failed: cannot change database mid-query`
- Raw map with custom ID? HOT 11
- `Handle` doesn't allow reads after `get_mut`
- `non_local_definitions` warning causes issues
- Expose API to test whether a query was validated using shallow or deep verification
- Stack overflow on master HOT 4
- Make Storage Sync
- Which example to use to replace outdated reference in README to hello_world
- Const queries no longer compile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salsa.