Repository navigation
Commit fc7aad6
Gate: kernel residuals read the kernel sources' string literals, so a label GCC splits stays live (INT16b)
PR #278 failed on every Linux job that judges the kernel archive (kernel-only's
kernel-residuals stage; the test_kernel_residuals row of build ubuntu-24.04
Release and of native-live):
check_kernel_residuals: stale '__kernel_liquidation__': ruled in ADR-0001
but no longer in the archive or the installed headers; drop its row
Mechanism, reproduced on spark with x86_64-linux-gnu-g++-13 (13.3.0-6ubuntu2~
24.04.1, the runner's exact compiler) and the kernel profile's own configure
argv -- 5105 nm -C lines, 20886 strings -a lines, 173 archive hits, the same
finding. src/native_execution_consumer.cpp declares
`constexpr char kNativeLiquidationLabel[] = "__kernel_liquidation__"` and
uses it only as the default branch of a std::string ternary in
NativeExecutionConsumer::kernel_submit_liquidation. Its address is never
taken, so GCC emits no array and builds the 22-byte string inline:
movq $0x16,-0x240(%rbp) ; length 22, then _M_create
movdqa .LC168(%rip),%xmm0 ; "__kernel_liquida" (.rodata.cst16)
movabs $0x5f5f6e6f69746164,%rcx ; "dation__"
movups %xmm0,(%rax)
mov %rcx,0xe(%rax) ; overlapping 8-byte store at +14
The first 16 bytes sit in .rodata.cst16 packed beside other vector constants
(strings prints "native-consumer/native-driver/v5native-calendar/
__kernel_liquidaMargin liquidati"), the tail is an instruction immediate, and
no contiguous label exists in the object. kNativeRiskLabel survives because it
is passed as `const char*` to kernel_submit_liquidation, which forces the
array into .rodata. clang (macOS: 146 hits) and GCC on aarch64 (spark: 159
hits) keep the liquidation array too. Across the three archives the ruled
names present differ by exactly that one label (126 distinct names on
x86-64, 127 on the other two); the raw hit counts differ only by duplicate
lines (GCC's .cold clones, types repeated in demangled signatures), and every
hit is ruled on all three. The other 193 identifier rulings and the three
vocabulary texts are live everywhere; the eight remaining ADR phrases match no
vocabulary pattern and are never judged stale.
Fix, in the gate: a third surface, the string literals of the translation
units the archive was built from -- CMakeLists.txt's
set(PINEFORGE_KERNEL_SOURCES ...), checked to be exactly the archive's `ar t`
members, plus the src/ headers they include -- comments stripped and include
paths skipped (split_code_and_literals, the lexer the header surface uses).
It is judged in both directions like the other two: a ruling stays live while
any surface carries it, and a vocabulary literal a kernel TU compiles needs a
row even where the compiler split it. Why not the code: forcing the array into
the object (taking its address, external linkage) would change the kernel's
hottest TU to satisfy one scanner on one compiler, and the next literal GCC
splits would fail the same way; the literal is real either way, so the gate
reads it where it is written. Not weaker: a row whose text left every surface
is still stale on every platform, a comment or an include path never makes one
live, a source-layer TU's literal is never read (the list is the archive's),
and the source surface adds the forward check (8 hits, all ruled).
Self-tests (scripts/test_check_kernel_residuals.py, KernelSourceSurfaceTests,
7 cases): PR #278's strings line alone reads stale; the TU's literal makes it
live; a ruling no surface carries is still stale; a comment or an include path
is not a literal; an unruled kernel-source literal fails; the source set is the
archive's own list (a missing or extra member fails closed); the real kernel
sources carry no unruled literal. Fail-before against HEAD's checker: 6 of 7
error (no source surface), the reproduction case passes on both; a mutant that
drops the source hits fails 3. Suite: Ran 39 tests OK on macOS, spark aarch64
and spark x86-64 (each with its --archive).
macOS: ... 146 archive hits (143 identifiers, 3 texts), 269 installed-header hits and 8 kernel-source hits ... 0 findings ... OK
x86-64: ... 173 archive hits (170 identifiers, 3 texts), 269 installed-header hits and 8 kernel-source hits ... 0 findings ... OK
aarch64: ... 159 archive hits (156 identifiers, 3 texts), 269 installed-header hits and 8 kernel-source hits ... 0 findings ... OK
ADR-0001's residual section and contributing-llm.md name the third surface.
No src/ or include/ change.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>1 parent ca0aac5 commit fc7aad6
4 files changed
Lines changed: 275 additions & 19 deletions
File tree
- docs
- adr
- pages
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| |||
381 | 388 | | |
382 | 389 | | |
383 | 390 | | |
384 | | - | |
385 | | - | |
386 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
387 | 394 | | |
388 | 395 | | |
389 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
61 | 82 | | |
62 | 83 | | |
| |||
82 | 103 | | |
83 | 104 | | |
84 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
85 | 111 | | |
86 | 112 | | |
87 | 113 | | |
| |||
336 | 362 | | |
337 | 363 | | |
338 | 364 | | |
339 | | - | |
| 365 | + | |
| 366 | + | |
340 | 367 | | |
341 | 368 | | |
342 | 369 | | |
343 | | - | |
| 370 | + | |
| 371 | + | |
344 | 372 | | |
345 | 373 | | |
346 | 374 | | |
347 | 375 | | |
348 | 376 | | |
349 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
350 | 382 | | |
351 | 383 | | |
352 | 384 | | |
353 | 385 | | |
354 | | - | |
| 386 | + | |
355 | 387 | | |
356 | 388 | | |
357 | 389 | | |
| |||
383 | 415 | | |
384 | 416 | | |
385 | 417 | | |
386 | | - | |
387 | | - | |
| 418 | + | |
| 419 | + | |
388 | 420 | | |
389 | 421 | | |
390 | 422 | | |
391 | 423 | | |
392 | 424 | | |
393 | 425 | | |
394 | | - | |
| 426 | + | |
| 427 | + | |
395 | 428 | | |
396 | 429 | | |
397 | 430 | | |
398 | 431 | | |
399 | 432 | | |
| 433 | + | |
400 | 434 | | |
401 | 435 | | |
402 | 436 | | |
| |||
552 | 586 | | |
553 | 587 | | |
554 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
555 | 683 | | |
556 | 684 | | |
557 | 685 | | |
| |||
606 | 734 | | |
607 | 735 | | |
608 | 736 | | |
609 | | - | |
| 737 | + | |
610 | 738 | | |
611 | | - | |
| 739 | + | |
| 740 | + | |
612 | 741 | | |
613 | 742 | | |
614 | 743 | | |
615 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
616 | 749 | | |
617 | 750 | | |
618 | 751 | | |
619 | 752 | | |
620 | 753 | | |
621 | 754 | | |
| 755 | + | |
| 756 | + | |
622 | 757 | | |
623 | 758 | | |
624 | 759 | | |
| 760 | + | |
625 | 761 | | |
626 | 762 | | |
627 | 763 | | |
| |||
630 | 766 | | |
631 | 767 | | |
632 | 768 | | |
633 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
634 | 772 | | |
635 | | - | |
636 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
637 | 776 | | |
638 | 777 | | |
639 | 778 | | |
| |||
0 commit comments