Skip to content

fix(codegen): compile Cowlib MIME tables without allocation failure - #94

Merged
mremond merged 1 commit into
mainfrom
infinitary-batch/f9e3d4b3
Nov 27, 2026
Merged

mremond merged 1 commit into
mainfrom
infinitary-batch/f9e3d4b3

Conversation

@mremond

@mremond mremond commented Nov 27, 2026

Copy link
Copy Markdown
Member

Why

Cowlib's MIME table maps file extensions to content types, but the compiler ran out of memory while building it.

Approval queues this fix for the next combined pull request; it does not merge the fix immediately.

What changed

  • Build Cowlib's unchanged file-type table without raising the memory limit.
  • Keep the expected file type for every listed extension.
  • Check this behavior automatically on Linux.

Before and after

Before: The compiler ran out of memory under a 6,800,000 KiB memory limit.

After: The module now compiles and links within the 6,800,000 KiB memory limit; all 1,017 file-type checks pass.

This changes compiler memory use rather than a graphical view; recorded commands and program output demonstrate the result.

Checked

Live validation: Demonstrated for this version. 3 of 3 scenarios driven live in the product.

Scenario Result Evidence
Build and run the unchanged file-type table within the original memory limit. ✅ Passed live The recorded limit stays in effect for compilation and linking; Nera and standard Erlang complete all 1,017 checks.
Run the complete compiled-program checks without changing memory settings. ✅ Passed live 549 compiled-program tests pass, with two known skips; memory settings, error reports and the Rust checks also pass.
Build and run the existing Cowlib example. (supplementary) ✅ Passed live All 85 example calls return without exceptions; this is a smoke check, not a count of compiled modules.
  • Independent storage-sharing regression: The test rejects unsafe storage sharing and passes ten consecutive runs after the compiler is restored.
  • Existing Cowlib test suite: The test runner reports 101 tests, with three existing skips, using matching disposable development headers.
  • Independent reviews: The final code and its repaired live proof passed independent review.
  • Within-scope review corrections: Removed duplicate compiler work and added independent tests, complete lookup coverage and reuse of existing test sources under the project rules.
  • Supplementary example scope: The example proves 85 successful calls, not an independent count of compiled modules; the claim now matches the recorded output.
How it was checked

Built the runtime first, then ran cargo build --release --locked.

Ran cargo clippy --workspace --all-targets --locked -- -D warnings and cargo test --workspace --locked --no-fail-fast: 2,264 passed and one ignored.

The inherited umask 0002 exposed an existing storage-fixture failure; the complete workspace gate passes with umask 0022.

Ran nera test -j 1 --timeout 30, python3 scripts/test-allocator-config.py and python3 scripts/test-stacktrace-order.py.

Ran the pinned MIME integration regression ten times and the independent slot unit regression ten times, with negative controls for both.

Reran only the MIME scenario to retain exact commands, actual inherited object/link limits and both engine completion markers; the compiler digest remained identical.

The original compiler aborted at 5,142,956 KiB peak resident memory; the repaired object build completed at 2,345,648 KiB.

Ran the existing Cowlib example and Python harness discovery; matching OTP development headers were supplied in disposable storage.

Validated Linux x86-64 only. Full Cowlib upstream suites and native macOS/Windows execution are not established by this change.

Risk

Risk above low: Blast radius, high — Shared compiler storage assignment affects eligible functions throughout the project.; Novelty, medium — Adds conservative storage reuse beside existing compiler analysis.

Full risk assessment
Dimension Level Why
Blast radius high Shared compiler storage assignment affects eligible functions throughout the project.
Behavior low Corrects an allocation failure without changing intended lookup results.
Undo low Reverting the compiler and test changes requires no data migration.
Evidence low Memory-limited builds and all file-type lookups pass alongside the complete local gate.
Sensitivity low No sign-ins, keys, payments or persisted user data are changed.
Novelty medium Adds conservative storage reuse beside existing compiler analysis.
Dependencies low No package or toolchain dependencies change.

Build Cowlib's unchanged file-type table without raising the memory limit.

Keep the expected file type for every listed extension.

Check this behavior automatically on Linux.
@github-actions github-actions Bot added this to the 0.1.1 milestone Nov 27, 2026
@mremond
mremond merged commit 05e41e8 into main Nov 27, 2026
22 checks passed
@mremond
mremond deleted the infinitary-batch/f9e3d4b3 branch November 27, 2026 11:19
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.

1 participant