Skip to content

[Individual speedup unmeasured] Avoid atomic read-modify-write for serial virtual query IDs - #151

Draft
xmakro wants to merge 1 commit into
perf-review-20260907/37-serial-dep-colorfrom
perf-review-20260907/38-serial-virtual-index
Draft

[Individual speedup unmeasured] Avoid atomic read-modify-write for serial virtual query IDs#151
xmakro wants to merge 1 commit into
perf-review-20260907/37-serial-dep-colorfrom
perf-review-20260907/38-serial-virtual-index

Conversation

@xmakro

@xmakro xmakro commented Sep 7, 2026

Copy link
Copy Markdown
Owner

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.

Scenario Instruction change Cells
All scenarios +0.035% 83
Full +0.022% 20
Incremental full -0.000% 20
Incremental unchanged +0.065% 20
Incremental patched +0.051% 23

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.json and its adjacent per-cell CSV in the September 6 investigation directory. Final evidence: stage2-stack102-trained-paired-all-full.json and retained-v102-checkpoint.json.

@xmakro xmakro changed the title [part of 0.780% Check wall-time batch] Avoid atomic read-modify-write for serial virtual query IDs [Individual speedup unmeasured] Avoid atomic read-modify-write for serial virtual query IDs Sep 8, 2026
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.

1 participant