Skip to content

ci: native x86_64 runtime smoke test for the SHS seam#5

Merged
skhuang merged 3 commits into
mainfrom
skhuang/ci-smoke-native
May 31, 2026
Merged

ci: native x86_64 runtime smoke test for the SHS seam#5
skhuang merged 3 commits into
mainfrom
skhuang/ci-smoke-native

Conversation

@skhuang
Copy link
Copy Markdown
Collaborator

@skhuang skhuang commented May 31, 2026

Summary

  • Add smoke-linux.yml: a CI job that runs a short kofta-fuzz campaign on the native x86_64 ubuntu-22.04 runner and asserts the SHS serve co-process fires at runtime (a shs_cand,... line in the KOFTA_DEBUG log). build-linux only compile-checks — until now nothing exercised the runtime path end-to-end.
  • The runner is native x86_64 + ships clang-12, exactly what docker/run-smoke.sh's container emulated, so we run the script directly (no Docker). KOFTA's x86_64-only argv-leak asm — which broke under local arm64/Colima emulation — works natively here.
  • Make run-smoke.sh reusable outside the container via SMOKE_REPO/SMOKE_BUILD/SMOKE_WORK env overrides: when BUILD == REPO it builds in place and skips the read-only-mount copy.

Why this matters

This is the first time the SHS C seam (serve co-process, NDJSON IPC, env-var contract from #4) is verified at runtime rather than just compiled. A green smoke job means: afl-fuzz launched kofta-shs serve, streamed a request, and got candidates back through the forkserver — no real machine or API budget required (offline --mock).

Test plan

  • bash -n docker/run-smoke.sh and YAML validation pass locally.
  • The smoke job itself is the test — it must go green on this PR (shs_cand line present). Crash reproduction is a printed bonus, not gated (fork-timing varies).
  • build-linux (compile-only, default + KOFTA_DEBUG) stays green.

🤖 Generated with Claude Code

skhuang and others added 3 commits May 31, 2026 17:29
build-linux only compile-checks; nothing exercised the runtime path
end-to-end. GitHub's ubuntu-22.04 runner is native x86_64 + clang-12 --
exactly what docker/run-smoke.sh's container emulates -- so run the
script directly there (no Docker) and assert the SHS serve co-process
fires (a "shs_cand" line in the KOFTA_DEBUG log).

Make run-smoke.sh reusable outside the container via SMOKE_REPO/BUILD/
WORK env overrides: when BUILD == REPO it builds in place and skips the
read-only-mount copy.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The native ubuntu-22.04 run aborted on the dry run: KOFTA's __args_leak
reads argv/argc at a hardcoded stack offset (lea 0x50(%rsp), +0xc) tuned
for glibc <=2.33's __libc_csu_init. glibc 2.34 (22.04) refactored
startup, so the offset is wrong and the forkserver dies before any SHS
code runs. Run inside an ubuntu:20.04 container (glibc 2.31) -- the
authors' toolchain -- which also ships clang-12 for the legacy LLVM pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The local smoke image had the same latent bug the CI job hit on 22.04:
KOFTA's __args_leak ("lea 0x50(%rsp)", +0xc) is tuned for glibc <=2.33's
__libc_csu_init startup. glibc 2.34 (22.04) refactored startup, so the
offset points at garbage and the forkserver dies on the dry run. 20.04
ships glibc 2.31 (offset valid) and clang-12, matching the now-CI-proven
working environment.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@skhuang skhuang merged commit 9797746 into main May 31, 2026
2 checks passed
@skhuang skhuang deleted the skhuang/ci-smoke-native branch May 31, 2026 11:09
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