[Individual speedup unmeasured] Avoid atomic read-modify-write for serial virtual query IDs - #151
Draft
xmakro wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use load/store for unique virtual IDs only in serial mode, retaining atomic fetch-add in parallel mode and the dynamic thread-mode sharing guard.
Batch measurement, not an isolated gain. The table below reports the whole historical Check batch. This PR separates one component for reading; its individual contribution has not been measured. Do not add or multiply the repeated batch numbers.
Comparison: stack-v31 versus stack-v30b, fresh paired Check run.
Instruction counts improve in 18/83 cells. All cells have two observations with instruction spread at most 0.5%. Negative changes mean less work.
The same comparison records wall time -0.780% and peak RSS -0.112%. The Check timing comparison alternates compiler order by crate.
These two serial changes were measured together: wall time -0.780%, instructions +0.035%. Their individual contributions were not ablated. One/four-thread and ordinary/retained-graph stress configurations passed.
The historical screen uses the stock rustc-perf collector, all 20 Primary benchmarks and 83 Check/scenario cells, with native hardware counters. These early source screens predate Rust PGO; large sequential wall-time/RSS differences were not attributed to these patches. Scenarios and benchmark patches, incremental hash verification and one frontend thread are preserved. Results are equal-cell geometric means; two repetitions give a quick estimate, not a full CI campaign.
Personal review series, change 38/45. Both base and head are in this fork. The base is the preceding review branch so the Files changed view contains only this change.
The complete retained v102 stack was separately rebuilt and independently PGO-trained, then measured in a fresh paired 249-cell Check/Debug/Opt run: instructions -10.227%, wall time -7.611%, peak RSS -1.601%. The local configuration reuses CI LLVM and fixed standard libraries; it omits LLVM retraining, BOLT and the self-profile measurement pass. This combined result is not an individual PR contribution.
Validation of retained checkpoints and the final compiler includes 21,944 UI, 180 incremental, 409 MIR and 1,067 LLVM codegen tests, plus relevant unit tests and repeated incremental stress. Splitting commits changes no compiler source: the final Git tree matches the tested input exactly. Intermediate review branches have not each been rebuilt. Commit messages skip automatic CI for this reading-only series.
Local evidence:
stack31-paired-contribution-check.jsonand its adjacent per-cell CSV in the September 6 investigation directory. Final evidence:stage2-stack102-trained-paired-all-full.jsonandretained-v102-checkpoint.json.