Skip to content

docs: independent reproduction and cold-start fixes - #8

Merged
kavyabhand merged 5 commits into
mainfrom
docs/independent-reproduction
Aug 2, 2026
Merged

kavyabhand merged 5 commits into
mainfrom
docs/independent-reproduction

Conversation

@kavyabhand

Copy link
Copy Markdown
Member

Summary

  • Independently reproduced the submission on Apple M1 / macOS 15.1.1 (Darwin arm64) and arm64 Docker; full table in docs/REPRODUCTION.md.
  • Fixed judge-path Docker on Apple Silicon: Dockerfile now selects the Zig 0.16.0 tarball by TARGETARCH (pinned SHAs for x86_64-linux and aarch64-linux).
  • Fixed host cold-start scripts for macOS bash (empty-array set -u, BSD sed -i, shasum fallback, missing objcopy skip) and stopped the README claim checker from silently rewriting before checking.
  • Proved gates can fail (docs/evidence/gate-failure-proofs.md); added PR template asking for the four assertion counts.

Four assertion counts (required before merge)

Config Required Measured (Zig-linked) Measured (C-linked)
default 4930/4930 4930/4930 4930/4930
pow 4924/4924 4924/4924 4924/4924
natlog 4934/4934 4934/4934 4934/4934
pow_natlog 4928/4928 4928/4928 4928/4928

Also confirmed inside docker compose up --build verify after the Dockerfile fix (VERIFY OK in 122.71s).

Evidence artifacts touched

  • docs/REPRODUCTION.md (new)
  • docs/evidence/gate-failure-proofs.md (new)
  • docs/evidence/upstream-diff.txt (new live fetch log)
  • docs/journal.md (append)
  • DECISIONS.md (D030-D032)

Gates exercised

  • scripts/verify-original-hashes.sh
  • scripts/fetch-upstream-and-diff.sh
  • zig build fmt-check / host zig build test (four configs)
  • escape-hatch count
  • README claims / rendered region (and planted-overclaim failure after fix)
  • zig build verify (host; enumeration skipped without objcopy)
  • docker compose up --build verify

Notes for reviewers

  • Nest cliff differs by host: Linux first machine crash at 20144; this Mac crash at 23764 (ulimit -s ~8k both). Suite counts are unchanged.
  • Did not touch fuzz/ or long-running campaigns.

Apple Silicon docker compose was installing x86_64 Zig into an arm64
Ubuntu image and failing at link with invalid ELF machine type AARCH64.
Empty-array set -u, BSD sed -i, sha256sum/shasum, and missing objcopy
all broke the host cold-start path on Darwin.
The claims script re-rendered the scorecard region first, so a planted
wrong fraction still exited 0. Check-only; verify renders explicitly.
Record cold-start friction, host-dependent nest cliffs, licence review,
and which CI gates were watched failing on a second machine.
Copilot AI review requested due to automatic review settings August 2, 2026 10:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the project’s “cold start” and independent reproducibility story across macOS (Apple Silicon) and Docker by hardening verification scripts, fixing multi-arch Zig selection in the Docker judge path, and adding structured reproduction/evidence documentation.

Changes:

  • Make Docker judge builds work on arm64 by selecting the Zig Linux tarball via TARGETARCH, with pinned SHA-256 per arch.
  • Improve host script portability (macOS bash 3.2, BSD sed -i, missing sha256sum/objcopy) and make README claim checking non-mutating.
  • Add reproduction tables, gate-failure proofs, and process metadata (PR template + decisions log).

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/verify.sh Improves portability (sed -i), skips enumeration when objcopy is missing, and separates README render/check steps.
scripts/verify-original-hashes.sh Adds shasum -a 256 fallback for hosts without sha256sum.
scripts/run-original-suite.sh Adjusts flag handling to avoid macOS bash 3.2 set -u empty-array issues.
scripts/run-enumerate.sh Removes mapfile, adds objcopy detection and GNU/BSD nm compatibility handling.
scripts/check-readme-claims.sh Stops rewriting README prior to checking numeric claims.
README.md Updates build prerequisites and clarifies Docker-first verification path.
docs/REPRODUCTION.md New independent reproduction report and measured claim table.
docs/journal.md Adds a dated journal entry documenting the second-machine reproduction work.
docs/evidence/upstream-diff.txt New evidence artifact recording upstream fetch/diff results.
docs/evidence/gate-failure-proofs.md New evidence artifact proving key gates fail under intentional mutations.
Dockerfile Fixes Apple Silicon Docker builds by selecting Zig tarball by TARGETARCH with pinned hashes.
DECISIONS.md Records decisions D030–D032 for multi-arch Docker, README gate behavior, and host portability.
.port-mortem.toml Records additional official Zig SHA-256 values (aarch64 linux/macos) alongside the existing pin.
.gitignore Ignores host layout probe binaries.
.github/PULL_REQUEST_TEMPLATE.md Adds a template requiring the four assertion counts and related evidence/gate checklist.
Suppressed comments (2)

scripts/run-original-suite.sh:40

  • The loop uses an unquoted ${@+"$@"} expansion, which can trigger pathname expansion (globbing) and can also split arguments unexpectedly if any flag ever contains whitespace. Since these are already positional parameters after shift, iterate safely with for f in "$@"; do.
for f in ${@+"$@"}; do

scripts/run-enumerate.sh:99

  • The objcopy invocation expands RENAME_ARGS unquoted. If any element ever contains shell metacharacters it can be glob-expanded or split. Since RENAME_ARGS is always initialized to an array, use a quoted array expansion ("${RENAME_ARGS[@]}").
"$OBJCOPY" ${RENAME_ARGS[@]+"${RENAME_ARGS[@]}"} "$ORIGINAL_OBJECT" "$RENAMED_OBJECT"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

PREFIX="$ROOT/zig-out-$NAME"
rm -rf "$PREFIX"
zig build "${ZIG_FLAGS[@]}" -p "$PREFIX" --cache-dir "$CACHE"
zig build ${@+"$@"} -p "$PREFIX" --cache-dir "$CACHE"
Comment thread scripts/run-enumerate.sh
Comment on lines 87 to 90
RENAME_ARGS=()
for symbol in "${EXPORTED[@]}"; do
for symbol in ${EXPORTED[@]+"${EXPORTED[@]}"}; do
RENAME_ARGS+=(--redefine-sym "$symbol=c_$symbol")
done
CI docker-build-and-verify timed out resolving docker/dockerfile:1.7
from registry-1.docker.io. The image does not need that frontend.
@kavyabhand
kavyabhand merged commit 609f036 into main Aug 2, 2026
42 checks passed
@kavyabhand
kavyabhand deleted the docs/independent-reproduction branch August 2, 2026 10:26
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.

2 participants