https://pantsbuild.org/ logo
#development
Title
# development
h

happy-kitchen-89482

12/04/2021, 10:51 PM
Where do we compute the fingerprint of a dataclass (e.g., a Process)?
h

hundreds-father-404

12/04/2021, 11:11 PM
I believe the hash function, which is auto-done by dataclass. For some intrinsics, we now define them in Rust and manually implement hash. See fs.rs
h

happy-kitchen-89482

12/04/2021, 11:25 PM
It's only guaranteed to return the same result for the same input within a single process
I hope not, because Python hash() isn't consistent across processes
But I doubt that's what we're using since we'd get no cache hits across a pantsd restart, and presumably wed have noticed
f

fast-nail-55400

12/05/2021, 12:28 AM
for CAS purposes, the cache key is the sha-256 hash of the encoded REAPI protobuf
👍 1
at least for remote execution
h

happy-kitchen-89482

12/05/2021, 1:55 AM
Where in the code is this computed?
I'm trying to debug a cache miss that shouldn't be
the action digest is being used as the cache key
(the REAPI action includes the command digest and input root digest)
do you have debug logs of the command/action protos? if not, maybe add a debug log of the action and command protos in the `digest` function and see exactly what is being computed
`-ldebug`does print the protos out so would be helpful to see logs from both runs
h

happy-kitchen-89482

12/05/2021, 4:04 PM
Cool, that is very helpful