Skip to content

runtime: advance apk-info mmap pressure by rounding, topology growth, and bounded reservation fixes - #99

Merged
thanks-cohn merged 1 commit into
mainfrom
codex/execute-batch-32v-plan-on-main
Aug 16, 2026
Merged

runtime: advance apk-info mmap pressure by rounding, topology growth, and bounded reservation fixes#99
thanks-cohn merged 1 commit into
mainfrom
codex/execute-batch-32v-plan-on-main

Conversation

@thanks-cohn

Copy link
Copy Markdown
Owner

Motivation

  • Close a stale validation-evidence debt and then trace the real Alpine apk info crash (musl memset store to 0x8) back to its first causal producer so the smallest general bounded repair can be applied.
  • Make the smallest, general runtime mapping/mmap semantics changes that admit measured real allocator/topology demands (rather than special-casing apk or musl) and add focused permanent tests so the causal loop can be rerun deterministically.

Description

  • Regenerated canonical validation evidence with the repository tooling and updated generated/validation/modules.json to close the stale-evidence failure found by the doctor tooling.
  • Added checked Linux mmap byte-length rounding and a roundedLength helper plus focused unit tests in recipes/run-hosted-morphic-runtime/src/bounded_runtime_mappings.zig to accept Linux byte-length requests that touch partial pages.
  • Implemented address-zero anonymous reservation semantics and tightened anonymous/mmap handling in recipes/run-hosted-morphic-runtime/src/freestanding_riscv64.zig, including checked rounding, reservation and rollback semantics, atomic prepared-backin mapping, and narrow trap/register diagnostics for tracing edge faults.
  • Increased measured topology bounds (mapping table capacity and prepared/backing sizes), switched large exec/fork image handling to prefix/memcpy semantics to avoid overwriting live backing, added focused admission tests for the observed mapping-count and rounding cases, and persisted a Batch 32V report and COMMANDS.md update documenting the causal loop and next blocker (files changed include recipes/run-hosted-morphic-runtime/src/{bounded_runtime_mappings.zig,freestanding_riscv64.zig}, generated/validation/modules.json, docs/reports/AGENTIC_SNOWBALL_BATCH_32V.md, and COMMANDS.md).

Testing

  • Created the repository virtual environment and regenerated all-level validation evidence with PYTHONDONTWRITEBYTECODE=1 python3 tools/python-environment.py tools/record-validation.py --level all, which completed and updated generated/validation/modules.json.
  • Ran recipe/unit surfaces including zig build test-recipe-run-hosted-morphic-runtime and zig build install-freestanding-riscv64-morphic-runtime and executed the recipe test suite, which passed.
  • Performed real QEMU pressure under QEMU 8.2.2 driving /sbin/apk --version, /sbin/apk --help, and repeated apk info attempts; /sbin/apk --version succeeded and /sbin/apk --help reached apk output, and causal retries advanced past the originally failing allocation and produced explicit mmap/mapping diagnostics, but apk info did not complete successfully in the final bounded retry (observed behaviour and measured mmap/mapping outputs are recorded in the Batch 32V report).
  • Ran repository aggregate validation (zig build check, python3 tools/developer-command.py validate-repository) and command-reference checks (PYTHONDONTWRITEBYTECODE=1 python3 tools/check-command-reference.py --check), which passed (local validation evidence: 350/350 steps and 249/249 tests); these local results are recorded in the attached report but do not claim external CI state.

Codex Task

@thanks-cohn
thanks-cohn merged commit efd18a0 into main Aug 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant