Refine CI and build to compile/run C examples
Merged
JS
2mo ago+725+725+012345678901234567890123456789-121-121-012345678901234567890123456789
Summary by cubic
Refined CI and build to compile and run the C examples, rebuild the PDF when examples change, and block releases on failing code. Improved CI diagnostics and tightened security scanning.
-
New Features
- Added examples CI job on ubuntu-24.04 running
.ci/check-newline.sh,.ci/check-format.sh(pinnedclang-format-20),.ci/check-security.sh,.ci/check-cppcheck.sh, thenmake -C examples check;releasenow depends onbuildandexamples; PR runs can cancel, pushes tomainnever do;workflow_dispatchcan republish. - Forced PDF rebuilds when embedded examples change by deriving sources from
\inputmintedand runninglatexmk -g; cached TeX and_mintedkeyed on the pinned container with restore keys; cleaned/ignored generated artifacts. - Reworked
examples/Makefile: per-target rules withoverride CFLAGS; detect x86-64 via compiler macros to pass-mcx16; probe-latomic; keep callerCPPFLAGS/LDFLAGS; rebuild when the toolchain/flags change via a signature stamp that includes the compiler version and safely escapes quotes;checkasserts exact stdout;formatusesCLANG_FORMAT; README documents C11 threads and-mcx16/libatomic.
- Added examples CI job on ubuntu-24.04 running
-
Bug Fixes
- Queue correctness: never claim the idle sentinel (re-check on each CAS iteration); aligned and aligned-allocated the idle job (and 16-byte
v_prev); dropped the stale front link when the queue drains; in the versioned variant, claimed with a guarded loop and published pointer+version in one 16-byte store. - Lifecycle/exit status: checked
thrd_createand unwound cleanly; freed unclaimed futures (and results) on cancel; waited for workers to publishidlebeforetpool_destroy; failed runs on init/add_job/result allocation errors and reported via exit status. - CI checks: fixed false negatives in
.ci/check-security.sh(perform translation phase 2 first, preserve line numbers, replace comments with spaces, no SIGPIPE; detect#undef _FORTIFY_SOURCE/__SSP__);.ci/check-format.sh,.ci/check-newline.sh,.ci/check-cppcheck.shprint actionable errors and clean temp files. - Docs/listings: made the ABA demo deterministic with a flag handshake and joins; updated the worker listing with the idle-sentinel guard and correct acquire/release orders (state load and job-pointer load are acquires; CAS failure is an acquire); minor cleanups.
- Queue correctness: never claim the idle sentinel (re-check on each CAS iteration); aligned and aligned-allocated the idle job (and 16-byte