Skip to content

Comments

fix: in stats, Compare values AND keys to have a fully deterministic order#2403

Merged
sylvestre merged 3 commits intomozilla:mainfrom
iTrooz:deterministic_stats
Sep 25, 2025
Merged

fix: in stats, Compare values AND keys to have a fully deterministic order#2403
sylvestre merged 3 commits intomozilla:mainfrom
iTrooz:deterministic_stats

Conversation

@iTrooz
Copy link
Contributor

@iTrooz iTrooz commented Jun 8, 2025

When using watch sccache -s, the order of "Successful distributed compiles" can change randomly if two keys have the same value
This PR fixes this

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.60%. Comparing base (9fd99c7) to head (0ca0667).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2403      +/-   ##
==========================================
+ Coverage   71.58%   71.60%   +0.01%     
==========================================
  Files          65       65              
  Lines       36372    36400      +28     
==========================================
+ Hits        26037    26064      +27     
- Misses      10335    10336       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@iTrooz iTrooz changed the title in stats, Compare values AND keys to have a fully deterministic order fix: in stats, Compare values AND keys to have a fully deterministic order Jun 14, 2025
@iTrooz iTrooz force-pushed the deterministic_stats branch from 45423c9 to 2097f0e Compare June 29, 2025 13:53
@sylvestre
Copy link
Collaborator

Could you please add a quick test to make sure we don't regress in the future? thanks

@iTrooz
Copy link
Contributor Author

iTrooz commented Jun 29, 2025

Done ! Note that the test is not foolproof, because of the randomness in hashmap looping

@iTrooz
Copy link
Contributor Author

iTrooz commented Aug 1, 2025

@sylvestre Hello, any news ?

When using `watch sccache -s`, the order of "Successful distributed compiles" can change randomly if two keys have the same value
This PR fixes this
@sylvestre sylvestre merged commit 333131e into mozilla:main Sep 25, 2025
55 checks passed
@iTrooz iTrooz deleted the deterministic_stats branch September 25, 2025 13:58
tottoto pushed a commit to tottoto/sccache that referenced this pull request Feb 6, 2026
## Motivation
The `Status` struct is the canonical error message in `tonic`. Printing
it currently prints out a very verbose and difficult-to-read message.

## Solution
Improve `impl, Display for status` by:

* Only printing the `message` if it is non-empty
* Only printing the `metadata` if it is non-empty`
* Always omitting the binary `details` (printing out `details: [22, 51,
50, 48, 51, 53, 98, 57, 50, 55, 50, 55, 100, 54, 101, …]` is not helping
anyone)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants