Skip to content

Commit e2cbedf

Browse files
alex-spataruclaude
andcommitted
revert(ci): drop the spec-0090 post-link layout stage
Reverts the BOLT stage and its ten follow-up fixes back to the pre-spec-0090 tree. Once both arches finally cleared every gate, the rewritten binaries measured within noise of the plain PGO+LTO build (arm64 Lua 1.00M vs 1.02M FPS, most tiers -1 to -2%), so the stage bought nothing for a large fragility surface: pac-ret unwind needed BOLT 22, llvm-bolt segfaulted on prebuilt gRPC, and objcopy, strip and linuxdeploy each corrupt a rewritten ELF. The macOS order-file and Windows symbol-order pieces from the same commit go with it; they can return under a future spec (CSPGO is the stronger candidate). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5f43066 commit e2cbedf

10 files changed

Lines changed: 13 additions & 1034 deletions

File tree

‎.claude/skills/cpp-compiler-flags/references/serial-studio-build-flags.md‎

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -124,50 +124,6 @@ failure precisely because a killed run writes no profile. The training runs *are
124124
representative workload that makes PGO help instead of hurt; the 256 kHz gate is a hard
125125
release gate on the shipped PGO binary. See [[ss-hotpath]].
126126

127-
### Post-link layout (ENABLE_POST_LINK_LAYOUT, spec 0090)
128-
129-
OFF by default; only the release CI pipelines pass it, at **both** PGO configures (the
130-
stage-identity rule governs the `-D` values, so the option never varies between GENERATE and
131-
USE). One mechanism per platform, all downstream of PGO:
132-
133-
- **Linux ELF (x86-64/aarch64; armv7l excluded -- BOLT has no 32-bit ARM port):** the module
134-
only makes the link BOLT-ready: `-Wl,--emit-relocs`, plus GCC
135-
`-fno-reorder-blocks-and-partition` (pre-split functions are ones BOLT must skip; its own
136-
`-split-functions` replaces that optimization). The rewrite itself is CI's
137-
`.github/actions/bolt-linux`: drop orphan `.cold` symbols (the prebuilt gRPC carries
138-
ICF-orphaned fragments BOLT hard-fails on) -> instrument -> re-run both training loads
139-
(seat already active; the trainer's exit code is advisory and a crash prints a gdb
140-
backtrace -- the profile is dumped every 5 s during the run, so a teardown crash loses
141-
nothing) -> `merge-fdata` -> two `llvm-bolt -reorder-blocks=ext-tsp
142-
-reorder-functions=cdsort -split-functions -split-all-cold -dyno-stats` rewrites, with
143-
`-skip-funcs` covering the LuaJIT VM asm and the gRPC/upb/protobuf-C families. The BOLT
144-
pin must stay >= 22: Hardening.cmake's `-mbranch-protection=standard` (pac-ret, Linux
145-
aarch64) needs BOLT's OpNegateRAState CFI support (llvm/llvm-project#120064) -- BOLT 21
146-
drops the RA-state markers and the first unwind through a rewritten frame (a routine
147-
LuaJIT trace abort suffices) segfaults in libgcc on a still-signed return address. BOLT is
148-
the only post-link writer: objcopy/strip corrupt a rewritten ELF (llvm/llvm-project#89336),
149-
so the shipping rewrite uses `-remove-symtab` (the spec-0084 hardening strip) and BOLT's
150-
built-in debug/`--emit-relocs`-payload stripping, while a layout-identical
151-
`-update-debug-sections` twin exists only so the `.debug` sidecar can be cut from it
152-
(`objcopy --only-keep-debug` reads the twin, never the shipped binary). The POST_BUILD
153-
split/strip in `app/CMakeLists.txt` is disabled entirely when the option is ON. Fail-hard:
154-
there is no fallback to the un-rewritten binary, and every gate/package/signature below
155-
the stage consumes the rewritten one.
156-
- **macOS (AppleClang, PGO-USE only, arm64 slice only):** no Mach-O rewriter and no linker
157-
swap; the module derives a hot-function order file from `merged.profdata`
158-
(`llvm-profdata show --topn`, `_`-prefixed for Mach-O) into `hot-order.txt` and links with
159-
`-Wl,-order_file,...`. An empty order file is a configure-time FATAL_ERROR. The x86_64 leg
160-
builds without PGO and never sets the option.
161-
- **Windows (clang-cl):** no new mechanism -- lld-link already sorts functions by the PGO
162-
call-graph profile. The module adds the native lld-link flag
163-
`/print-symbol-order:${CMAKE_BINARY_DIR}/symbol-order.txt` and ci.yml asserts the file is
164-
present and non-trivial after the optimized link; weakening that assertion is not an option
165-
(the documented fallback is a generated `/call-graph-ordering-file`).
166-
167-
Layout/metadata only: the IEEE-math and unwind-table invariants are untouched by
168-
construction, and the rewritten binary's unwind is proven per push by the `script-unwind`
169-
pre-root selftest suite (a Lua error raised through a C frame must land back in the host).
170-
171127
### Flags deliberately NOT enabled
172128
`-fcomplete-member-pointers` (clang family). Rejects a pointer-to-member whose class is still
173129
incomplete -- under the MSVC ABI the representation follows the inheritance model, so an

‎.github/actions/bolt-linux/action.yml‎

Lines changed: 0 additions & 228 deletions
This file was deleted.

0 commit comments

Comments
 (0)