TraceMachina / TraceMachina/nativelink
Explore Validity of AC Store Comments in Store Trait
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 244
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 54
Description
The CAS contractually has the size encoded in it so it's easy to know, the Action Cache does not have this. It's the size of the command not the size of the item.
Inclination is that the size is valid, however it should be verified.
The two 'Note' comments are the ones in question in store_trait.rs:
/// Look up a digest in the store and return None if it does not exist in
/// the store, or Some(size) if it does.
/// Note: On an AC store the size will be incorrect and should not be used!
#[inline]
async fn has(self: Pin<&Self>, digest: DigestInfo) -> Result<Option<usize>, Error> {
let mut result = [None];
self.has_with_results(&[digest], &mut result).await?;
Ok(result[0])
}
/// Look up a list of digests in the store and return a result for each in
/// the same order as input. The result will either be None if it does not
/// exist in the store, or Some(size) if it does.
/// Note: On an AC store the size will be incorrect and should not be used!
#[inline]
async fn has_many(self: Pin<&Self>, digests: &[DigestInfo]) -> Result<Vec<Option<usize>>, Error> {
let mut results = vec![None; digests.len()];
self.has_with_results(digests, &mut results).await?;
Ok(results)
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in store_trait.rs with has and has_many, then trace has_with_results through the Action Cache and CAS store implementations to compare the returned size with each digest's meaning. The work is done when the size behavior is established and the two Note comments accurately describe whether the value can be used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, build-system
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100