From ed90a1b231be822a59093125c4ce0fd614153d67 Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Sat, 4 Apr 2026 12:35:41 -0500 Subject: [PATCH] tidy repo root: move notes to docs/, repro to scripts/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - NOTES.md → docs/notes.md - repro_evented.zig → scripts/repro_evented.zig - update references in Dockerfile, main.zig, stdlib-patches.md - delete stale build artifacts (check_mutex.o, repro_evented binary) Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 2 +- NOTES.md => docs/notes.md | 0 docs/stdlib-patches.md | 4 ++-- repro_evented.zig => scripts/repro_evented.zig | 0 src/main.zig | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename NOTES.md => docs/notes.md (100%) rename repro_evented.zig => scripts/repro_evented.zig (100%) diff --git a/Dockerfile b/Dockerfile index 0f67df2..5a103f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN zig build --fetch-only 2>/dev/null || true # then copy source and build COPY src/ src/ # ReleaseFast (not ReleaseSafe): Io.Uring fiber context-switch GPFs under ReleaseSafe -# due to a zig 0.16-dev optimizer+safety interaction bug. See repro_evented.zig. +# due to a zig 0.16-dev optimizer+safety interaction bug. See scripts/repro_evented.zig. RUN zig build -Doptimize=ReleaseFast -Dcpu=baseline -Dtarget=x86_64-linux-gnu FROM --platform=linux/amd64 debian:bookworm-slim diff --git a/NOTES.md b/docs/notes.md similarity index 100% rename from NOTES.md rename to docs/notes.md diff --git a/docs/stdlib-patches.md b/docs/stdlib-patches.md index d742f1b..fa45210 100644 --- a/docs/stdlib-patches.md +++ b/docs/stdlib-patches.md @@ -99,7 +99,7 @@ RUN zig build -Doptimize=ReleaseFast ... under `ReleaseSafe`, the optimizer's inlining interacts badly with Uring's fiber context-switch machinery. the result is a general protection fault during normal fiber yield/resume. `ReleaseFast` and `Debug` both work. -`repro_evented.zig` in the repo root reproduces this — three simple fiber +`scripts/repro_evented.zig` reproduces this — three simple fiber tests (no-sleep, yield, sleep) that pass under Debug and ReleaseFast but GPF under ReleaseSafe. @@ -160,7 +160,7 @@ fiber dereferences `Thread.current()` — a threadlocal only set on Uring- managed threads. on Evented fibers it's NULL → SIGSEGV or heap corruption. this caused three separate crashes during the migration (crashes 1, 6, 8 in -NOTES.md). the fix pattern is always the same: components that use Threaded +docs/notes.md). the fix pattern is always the same: components that use Threaded resources (mutexes initialized with `pool_io`, pg.Pool) must run on plain `std.Thread`, not as Evented `io.concurrent()` fibers. diff --git a/repro_evented.zig b/scripts/repro_evented.zig similarity index 100% rename from repro_evented.zig rename to scripts/repro_evented.zig diff --git a/src/main.zig b/src/main.zig index 81636bb..8418e32 100644 --- a/src/main.zig +++ b/src/main.zig @@ -54,7 +54,7 @@ pub const default_stack_size = 8 * 1024 * 1024; // is NOT patched; subscribers resolve hostnames through pool_io (Threaded) instead. // // Known issue: Io.Uring GPFs under ReleaseSafe (optimizer + safety interaction). -// Build with ReleaseFast. See repro_evented.zig for minimal reproduction. +// Build with ReleaseFast. See scripts/repro_evented.zig for minimal reproduction. const Backend = Io.Evented; var backend: Backend = undefined; -- 2.51.2