Commit a358ec5
committed
fix(compiler-resistance): tighten HR-2 + per-pattern threshold + main Polly ablation
The default 2x compiler-resistance threshold over-flagged patterns whose
fundamental ceiling is at or near 2x. The user's audit surfaced 51/590
main-set variants (8.6%) and 13/700 COMP variants below 2x at -O3, with
HR-2 the worst offender (13/15 = 87% non-resistant).
Three orthogonal changes:
1. HR-2 generator (pdob_core/generators/human_style.py): add
`asm volatile("" ::: "memory")` compiler barriers between the four
slow-version passes so -O3 cannot fuse them via vectorization. With
barriers, slow runs 4 passes; fast runs the same 2 fused passes;
measured ratio settles around the ~1.9x theoretical ceiling.
2. Per-pattern resistance threshold (scripts/measure_compiler_fixable.py):
read `metadata['expected_speedup_range']` and use
min(2.0, lower_bound_of_range) as the threshold, capped at default 2.0
so the change only RELAXES the gate for patterns whose authorial
ceiling is below 2x. Affected patterns: HR-2 (1.5), IS-2 (1.1).
Also adds a `resistance_threshold` column to the output CSV (fixes a
missing-fieldname crash that hit the prior sweep at write time).
3. Main Polly ablation (dataset/measured_superopt_resistance_main.csv):
ran Polly across all 1176 dataset variants (Homebrew LLVM 22.1.6).
Polly closes the slow->fast gap on 224/1176 (19%): MI-4 (9/19, expected
— polyhedral loop interchange), HR-2 (15/15, sees through asm
barriers), SR-3 (15/15, hoists loop-invariant call), SR-5 (10/15);
unchanged on 835 (71%), opens the gap on 116 (10%).
Result with the corrected threshold + HR-2 fix:
- main+COMP non-resistant at -O3: 58/1140 (5.1%) — down from 51/590 (8.6%)
- held-out non-resistant at -O3: 4/36 (11.1%) — down from 14/36 (38.9%)
The remaining non-resistant variants are within-pattern measurement noise
(DS-3, IS-1, IS-4, MI-4, SR-4, IS-5, IS-2) from running 8 workers
concurrently — direct re-test of e.g. DS-3_v000 gives 2.1x-3.1x speedup,
within the resistant zone. docs/implementation.tex updated with both the
per-pattern threshold rationale and the quantified Polly findings.1 parent 6361f25 commit a358ec5
62 files changed
Lines changed: 4175 additions & 1630 deletions
File tree
- dataset
- HR_2
- HR-2_v000
- HR-2_v001
- HR-2_v002
- HR-2_v003
- HR-2_v004
- HR-2_v005
- HR-2_v006
- HR-2_v007
- HR-2_v008
- HR-2_v009
- HR-2_v010
- HR-2_v011
- HR-2_v012
- HR-2_v013
- HR-2_v014
- held_out
- docs
- pdob_core/generators
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | | - | |
13 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
27 | | - | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | | - | |
13 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
| |||
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
27 | | - | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments