Skip to content

Stress/gate v2 harness - #36

Merged
YUZHEthefool merged 3 commits into
mainfrom
stress/gate-v2-harness
Sep 1, 2026
Merged

Stress/gate v2 harness#36
YUZHEthefool merged 3 commits into
mainfrom
stress/gate-v2-harness

Conversation

@YUZHEthefool

Copy link
Copy Markdown
Member

Problem and outcome

Related issue or audit finding

Related: #

Design and scope

Kernel safety and invariants

  • Trust boundaries and attacker-controlled inputs:
  • unsafe / MMIO / page-table / usercopy justification:
  • IRQ, preemption, lock ordering, and SMP behavior:
  • Fallible allocation, quotas, and rollback/commit ordering:
  • ABI/layout/syscall compatibility:
  • Fail-closed and error-path behavior:

Validation evidence

make fmt-check
make clippy
make lint
make build
make boot-check
make test

Additional focused checks:

Compatibility, performance, and rollout

Checklist

  • The change is focused, bisectable, and free of unrelated refactoring.
  • I added a regression test or explained why an automated test is not practical.
  • I ran the relevant formatting, lint, build, runtime, ABI, SMP, storage, or fuzz gates listed above.
  • New unsafe blocks have local SAFETY reasoning and a minimized unsafe scope.
  • I preserved IRQ/lock-order rules, bounded attacker-controlled work, and reserve-before-commit accounting.
  • I updated architecture, safety, testing, roadmap, or user documentation when behavior changed.
  • New fixtures/artifacts are minimal, reproducible, redistributable, and contain no confidential data.
  • Breaking behavior, residual risk, deferred validation, and untested hardware are called out explicitly.

The monthly stress gate has never passed end-to-end; its green history is
last-day-of-month skips (2 real runs, both failed). This commit lands the
verified harness repairs and the missing guest:

- scripts/stress_test.sh: split the 'local duration=$1 deadline=...' set -u
  crash in wait_soak_window, and stop QEMU's writable 'fat:rw:' ESP from
  mutating BOOTX64.EFI in the source tree (per-boot throwaway ESP copy +
  stale NvVars drop) - the corruption produced a false bad-bootloader
  diagnosis this round.
- userspace/stress_runner.c: new NILIX_STRESS_V2 guest at the path the
  Makefile already expects - NILSTR2 config parser with independent
  SHA-256, marker/sequencing state machine, and the memory/cpu/smp/
  process/combined profiles; block fail-closes until fsync exists.
  Config/header handshake proven on a booted kernel (digest matches the
  host's make-config output).
- docs/stress-gate-status.md: the honest gate record - failure history,
  reconstructed V2 contract, kernel gaps K1-K4, open decisions.
- docs/quality-gates.md: mark the stress soak gate NOT GREEN and link the
  status doc.

Kernel-side gaps (K1-K4) remain open and are tracked as ST-K1..ST-K4 in
plan v15.60; do not treat this gate as passing until a profile produces a
validated PASS+HEARTBEAT from a booted run.
The VS Code extension's bundled rust-analyzer refuses to index
nightly-2025-12-08 ('toolchain too old'); listing the component makes the
extension launch the version-matched rustup rust-analyzer instead.
…d emit guest cgroup diagnostics

Kernel (debug builds only, R159-17 gating style; no addresses logged):
- E1 max_map_count, E2 cgroup_charge (error variant bound and named),
  E3 phase1_admission, E4 prot_none_commit (annotated-unreachable - the
  tag exists to falsify the annotation), E5 frame_alloc, E6 map_page,
  E7 phase2_track_reserve (heap-admission class, distinct from E5),
  E8 phase3_commit (no-rollback hazard: a hit here also wedges every
  later fork via the stuck PENDING entry).

Guest (userspace/stress_runner.c):
- emit_mmap_diag() prints a NILIX_STK3_DIAG line (run-cgroup + root
  stats via syscall 516, tolerated-failure, rc values reported) just
  before the FAIL marker; the prefix is deliberately NOT
  NILIX_STRESS_V2_* because stress_protocol.py's line filter and
  fullmatch FAIL regex (detail must be a bare integer) would reject
  free-form detail text.
- report_mmap/shared_mmap/memory_mmap/combined_mmap fail sites now
  route through fail_with_stats(); errno is captured at argument time
  so the stats syscalls cannot clobber it, and the helper never calls
  fail() itself (would consume the failure_emitted latch).

Design: docs/review/design/st-k3-mmap-enomem-design.md (plan v15.60,
ST-K3 Phase D). Diagnosis run + family selection follow separately.
@YUZHEthefool
YUZHEthefool merged commit aedf6f4 into main Sep 1, 2026
6 checks passed
@github-actions github-actions Bot added documentation Improvements or additions to documentation area: process/ABI Processes, syscalls, usercopy, signals, ELF, and Linux ABI area: userspace Ring-3 programs, libc compatibility, and userspace support area: tests Unit, hosted, runtime, QEMU, SMP, stress, and conformance tests area: tooling/CI Build system, scripts, hooks, automation, and repository tooling dependencies Dependency or toolchain updates size: XL At least 1000 review lines, excluding generated/binary artifacts labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: process/ABI Processes, syscalls, usercopy, signals, ELF, and Linux ABI area: tests Unit, hosted, runtime, QEMU, SMP, stress, and conformance tests area: tooling/CI Build system, scripts, hooks, automation, and repository tooling area: userspace Ring-3 programs, libc compatibility, and userspace support dependencies Dependency or toolchain updates documentation Improvements or additions to documentation size: XL At least 1000 review lines, excluding generated/binary artifacts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant