Skip to content

[Individual speedup unmeasured] Skip macro arms with provably incompatible first literals - #141

Draft
xmakro wants to merge 1 commit into
perf-review-20260907/27-flat-map-batchfrom
perf-review-20260907/28-macro-first-token
Draft

[Individual speedup unmeasured] Skip macro arms with provably incompatible first literals#141
xmakro wants to merge 1 commit into
perf-review-20260907/27-flat-map-batchfrom
perf-review-20260907/28-macro-first-token

Conversation

@xmakro

@xmakro xmakro commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Before cloning parser state, reject an incompatible first literal only for the no-diagnostic tracker. Diagnostic replay and special token equality retain the full matcher.

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-v21 versus stack-v17.

Scenario Instruction change Cells
All scenarios -0.475% 83
Full -0.296% 20
Incremental full -0.256% 20
Incremental unchanged -0.757% 20
Incremental patched -0.578% 23

Instruction counts improve in 68/83 cells. All cells have two observations with instruction spread at most 0.5%. Negative changes mean less work.

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 28/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: macro-matcher-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.475% Check instruction batch] Skip macro arms with provably incompatible first literals [Individual speedup unmeasured] Skip macro arms with provably incompatible first literals 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