Skip to content

G17-G22: OSIL now reads C + a correctness-gated loop optimizer - #5

Merged
cemphlvn merged 1 commit into
mainfrom
optimizer-track
Aug 24, 2026
Merged

cemphlvn merged 1 commit into
mainfrom
optimizer-track

Conversation

@cemphlvn

Copy link
Copy Markdown
Owner

Adds a C lowering profile, a mechanical loop optimizer, a capability model that prices its own blind spots, and a gate for the harness discipline that turned out to be the dominant failure mode.

Gates closed:
G17 C as an ecosystem profile with a tested preservation contract
(ADR-0014). may_lose { declared_licence } is the repo's first
may_lose field backed by an experiment rather than inspection:
restrict on every array pointer across 151 TSVC loops recovers 0.
G19 a lifter recovers dependence structure from C source alone (libclang),
reproducing a hand analysis measurement had already confirmed, 10/10.
G20 a chooser turns those facts into a transformation under three gates --
legal, correct, faster -- across four families.
G21 the architecture analyses its own reach: capabilities are declared
vocabulary (grammar v0.7), and the ceiling on what any chooser could
recover is DERIVED from them. just price prices a capability before
it is built.
G22 the harness discipline is checked rather than remembered. C-Reduce
named this bug class in 2012; it appeared eight times here.

Results, stated with their limits:
clang -O3 alone 64/151 = 42.4%
clang + pipeline 74/151 = 49.0% 10 kernels, all bit-identical or 1e-6
Every transformation is textbook 1980s work. No tuned baseline was beaten.
The published record (GCC 56.0%) is on different hardware and is NOT
comparable. The analyser's own ceiling is 52.3% -- below the record, and
knowable before the attempt started.

What the record shows going wrong, kept deliberately:

  • a pre-registered kill condition fired and was honoured (record-attempt.md)
  • s221 is RETRACTED as evidence for the speed gate: 1.0x under background load, 1.27x quiet. Contention changes speedups up to 3.8x and flips accept/reject (measurement-contention.md)
  • three wrong-code emissions caught by the correctness gate, including a scalar-dependence unsoundness that would have compiled and run
  • a false retraction of the Isaria citation, corrected from the primary PDF
  • a supermodularity claim about Wall 1993 corrected against the paper

demo/ is a standalone 30-second repro: one TSVC loop that clang and gcc both refuse to vectorize under -O3, -ffast-math, -Ofast, and both suggested pragmas -- next to a bit-identical rewrite worth ~5x. It asserts nothing; it runs the reader's own compilers and prints what they say.

Adds a C lowering profile, a mechanical loop optimizer, a capability model
that prices its own blind spots, and a gate for the harness discipline that
turned out to be the dominant failure mode.

Gates closed:
  G17  C as an ecosystem profile with a tested preservation contract
       (ADR-0014). `may_lose { declared_licence }` is the repo's first
       may_lose field backed by an experiment rather than inspection:
       `restrict` on every array pointer across 151 TSVC loops recovers 0.
  G19  a lifter recovers dependence structure from C source alone (libclang),
       reproducing a hand analysis measurement had already confirmed, 10/10.
  G20  a chooser turns those facts into a transformation under three gates --
       legal, correct, faster -- across four families.
  G21  the architecture analyses its own reach: capabilities are declared
       vocabulary (grammar v0.7), and the ceiling on what any chooser could
       recover is DERIVED from them. `just price` prices a capability before
       it is built.
  G22  the harness discipline is checked rather than remembered. C-Reduce
       named this bug class in 2012; it appeared eight times here.

Results, stated with their limits:
  clang -O3 alone      64/151 = 42.4%
  clang + pipeline     74/151 = 49.0%   10 kernels, all bit-identical or 1e-6
  Every transformation is textbook 1980s work. No tuned baseline was beaten.
  The published record (GCC 56.0%) is on different hardware and is NOT
  comparable. The analyser's own ceiling is 52.3% -- below the record, and
  knowable before the attempt started.

What the record shows going wrong, kept deliberately:
  - a pre-registered kill condition fired and was honoured (record-attempt.md)
  - s221 is RETRACTED as evidence for the speed gate: 1.0x under background
    load, 1.27x quiet. Contention changes speedups up to 3.8x and flips
    accept/reject (measurement-contention.md)
  - three wrong-code emissions caught by the correctness gate, including a
    scalar-dependence unsoundness that would have compiled and run
  - a false retraction of the Isaria citation, corrected from the primary PDF
  - a supermodularity claim about Wall 1993 corrected against the paper

demo/ is a standalone 30-second repro: one TSVC loop that clang and gcc both
refuse to vectorize under -O3, -ffast-math, -Ofast, and both suggested
pragmas -- next to a bit-identical rewrite worth ~5x. It asserts nothing; it
runs the reader's own compilers and prints what they say.
@cemphlvn cemphlvn changed the title G17-G22: OSIL now reads C, not just describes it. G17-G22: OSIL now reads C + superoptimizer Aug 24, 2026
@cemphlvn cemphlvn changed the title G17-G22: OSIL now reads C + superoptimizer G17-G22: OSIL now reads C + a correctness-gated loop optimizer Aug 24, 2026
@cemphlvn
cemphlvn merged commit 374b71b into main Aug 24, 2026
2 checks passed
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