fix(build): the giant function's estimate covers its measured peak #2248

Open
dazemc wants to merge 2 commits from dazemc/Longshot:mem-need-giant into main
Contributor

Summary

mem_need is the build's compiler-memory estimate, and it charged a lifted chunk 400 + 50 × MB of C + 250 × MB of its largest function. The units probe found that under-estimates the giant shape: code_024_1.c, 6.2994 MB of C with a 6.2449 MB function, peaked at 2,946 MB, while the formula charged 2,276 MB (1.29× under). On a memory-tight PC the gate can therefore start a compiler that does not fit.

This changes the largest-function coefficient to 360 MB/MB, so that shape charges 2,963 MB, just over the measured peak. The coefficient is a named constant (LARGEST_FUNCTION_MB) so the measured-peak refit in #2239 can take it without restating the number; #2239 is not edited.

This is a build-correctness fix, not a perf change: it can make the gate start fewer compilers for a giant shape, never more, and it claims no build-time gain.

Why 360 and not the rounded 339: 339 comes from the 6.6 MB file size shown by the probe. On the parsed 6.2449 MB largest function it charges 2,831 MB, 114 MB short of the 2,946 MB peak; 2,848 MB is 339 at the test stand-in's 6.29 MB function. Neither reaches the peak.

Read first: mem_need and largest_function in nx2/build.py, then the new check in tests/test_mem_gate.py.

See #2239 (the measured-peak refit) and #362 (the earlier memory-gate formula work).

AI assistance: written with an AI agent (OpenCode, DeepSeek V4.1 Flash).

Testing

Tested: Linux, this PC, game-free. No game run is needed: mem_need is read only by MemoryGate.enter; it is in no flag, object key, lift key or chunks.txt entry, so the built objects and game binary are identical with and without the change. python -I -B tests/test_mem_gate.py on the test-only commit 3afc8055 fails with FAIL: a giant function's need covers its measured peak (2288 MB against 2946 MB) (the check's 6,600,000-byte stand-in at 250 MB/MB); on the fix 487520d4 it passes: mem_need is 2,980 MB for that 6.294 MiB stand-in, above the 2,946 MB peak. The 2,963 MB figure is the units probe file code_024_1.c (6.2994 MB of C, 6.2449 MB largest function), not the stand-in. tests/test_mem_gate_leases.py and tests/test_mem_limit.py also pass.

Full suite recorded at the pre-rebase head 6350aa0b on a2dc5385: mise run test -- --jobs 5 under MemoryMax=12G, 911 passed, 23 failed, 18 skipped in 410 s (Linux, 5 at once). All 23 failures are the a2dc5385 baseline names:

nx2/test_import_windows.py
tests/test_close_waits_for_save.py
tests/test_compile_zero_byte.py
tests/test_cpm_discovery.py
tests/test_damaged_rom_files.py
tests/test_dev_packs.py
tests/test_draw_stream_visibility.py
tests/test_fs_save_commit.py
tests/test_fsr_uniform_ownership.py
tests/test_guest_copies.py
tests/test_hold_toggle.py
tests/test_lower_atomg_cas.py
tests/test_menu_i18n.py
tests/test_menu_keys.py
tests/test_menu_slider_ends.py
tests/test_mise_build.py
tests/test_pads_after_menu.py
tests/test_recording_admission.py
tests/test_sim_turf_pools.py
tests/test_sim_turf_settings.py
tests/test_switch_table.py
tests/test_tls_objects.py
tests/test_vibration_menu.py

The head is a byte-identical rebase of nx2/build.py and tests/test_mem_gate.py onto 8aa5ab87, which includes fe1c437c (#2213) that rewrote 17 of the 23 named files and reports main back to one failure (test_dev_packs). The suite has now run at this head: 942 passed, 19 failed, 18 skipped in 405 s (linux, 5 at once), its 19 failures exactly the CORE ids of SUITE-COMPARISON-RULE's Amendment 1 table; see the mise run test box.

Still to test:

  • A build-level comparison of the gate's admitted compilers on a memory-tight PC, by hand: expecting the giant's charge to rise to 2,963 MB and no more compilers to start for that shape.
  • Windows: python -I -B tests/test_mem_gate.py by hand or CI, expecting the same pass; the formula is platform-independent. No farm request is needed for a game-free check.

Measurements

Verdict: the estimate now covers the measured giant: 2,276 MB before against a 2,946 MB peak (1.29× under), 2,963 MB after (0.6% over). This is an estimate correction, not a speed gain; no build wall-clock A/B was run.

Setup: Linux, clang 23, the units run's lift, one compiler at a time, the compiler tree's peak RSS. The file is the units run's code_024_1.c (6.2994 MB of C, largest function 6.2449 MB).

Before: main @ 753fb5af After: this PR @ 487520d4
estimate for code_024_1.c 2,276 MB 2,963 MB
measured peak for the same file 2,946 MB 2,946 MB
estimate minus peak -670 MB (1.29× under) +17 MB (0.6% over)

git diff a2dc5385..753fb5af -- nx2/build.py tests/test_mem_gate.py is empty, and mem_need has the same body at 753fb5af and 8aa5ab87 (sha256 891f106ee27a4663f0009f240c08d20dc80d15ac55d60411e6eb4c44321357a6; tests/test_mem_gate.py is unchanged between them), so the 2,276 MB before value computed at a2dc5385 is exactly what current main (8aa5ab87) computes. The estimate and the focused check are base-independent; the suite is the part that moved (fe1c437c rewrote 17 of the 23 named files), and it has now run at this head, as Testing says.

No build A/B: the change only moves the gate's admission for a shape with a large function; it does not change the compile, the objects or the binary. A build with the same jobs and free memory may start the same number of compilers; the fix is that a giant is no longer under-reserved.

The fix's measurement is the test: 3afc8055 fails on main (2288 MB against 2946 MB) and 487520d4 passes (2,980 MB for the check's 6,600,000-byte stand-in; the probe's 2,963 MB is the table above); the focused check passes again at the rebased head. No build-time or size A/B is claimed; this estimator change cannot make a build faster and may start fewer compilers.

Risks

  • What could break: a larger charge for a file with a large function can make the gate start fewer compilers on a memory-tight PC, which can lengthen a build. Only chunks with a large function move much; ordinary units with small functions move by a few MB. The gate is safer, not faster.
  • Turning it off: revert the constant and the one line that uses it; there is no switch, saved data or cache key.
  • After updating: saves, longshot_options.ini, the shader cache and the pipeline cache are untouched. Only the build's memory estimate changes.
  • Cost: a giant now reserves up to about 110 MB/MB more. In the units build's free memory the giant compiled at most one at a time; the gate does not itself cap it at one — fits admits a second 2,963 MB compile once 7,462 MiB is free (2 × 2,963 + 1,536).

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. The merge base is 8aa5ab876d7cc3d5a19850f3cf7f29b2172c1863, which is current main, and head e0e7315c is that plus this PR's two commits (28f710b9 the check, e0e7315c the fix). One topic: git diff --stat origin/main...HEAD is nx2/build.py 9 lines and tests/test_mem_gate.py 9 lines (2 files, +15/−3), the giant function's memory estimate and its check; the title is fix(build): .... No rebase remains: the head already contains main.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (N/A: build tooling; the game binary and objects are identical, as Testing explains.)
  • mise run test passes (any failure that also fails on main is named). Suite at e0e7315c5374ae4d2dedeba0a83525c7f7549121: 942 passed, 19 failed, 18 skipped in 405 s (linux, 5 at once), exit 1. All 19 failures are CORE ids in SUITE-COMPARISON-RULE's Amendment 1 table and carry their recorded exception classes (tests/test_amd_subgroup_profiles.py, tests/test_appimage_package_retry.py, tests/test_cpm_discovery.py, tests/test_crt_options.py, tests/test_dev_packs.py, tests/test_flat_map.py, tests/test_guest_holes.py, tests/test_menu_save_atomic.py, tests/test_menu_text_field.py, tests/test_nonuniform_image_arrays.py, tests/test_pipeline_share.py, tests/test_rdna2_mesh_only.py, tests/test_readback_timeout_source.py, tests/test_rumble_menu.py, tests/test_shader_profile_caps.py, tests/test_target_image_reuse.py, tests/test_vibration_menu.py, tests/test_vram_compact.py, tests/test_wb_spans.py). No id outside CORE ∪ FLAKY failed, and the five FLAKY ids (tests/test_crash_record.py, tests/test_seed_reader.py, tests/test_program_cache_reader.py, tests/test_audio_source.py, tests/test_heart_containers.py) all passed here. Counts are not compared (Amendment 1). Log prrefresh-logs/suite-2248-e0e7315c.log, sha256 4e056e1b1cde18ded572c26b2877ad5102d8373bea729adf34646e03ceb04f3c; the JUnit reconciles (979 = 961 ran + 18 skipped; 942 + 19 = 961) and the skip set is identical.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers. (Both commits now carry Assisted-by: DeepSeek V4.1 Flash; the tree hashes are unchanged.)

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary `mem_need` is the build's compiler-memory estimate, and it charged a lifted chunk `400 + 50 × MB of C + 250 × MB of its largest function`. The units probe found that under-estimates the giant shape: `code_024_1.c`, 6.2994 MB of C with a 6.2449 MB function, peaked at 2,946 MB, while the formula charged 2,276 MB (1.29× under). On a memory-tight PC the gate can therefore start a compiler that does not fit. This changes the largest-function coefficient to 360 MB/MB, so that shape charges 2,963 MB, just over the measured peak. The coefficient is a named constant (`LARGEST_FUNCTION_MB`) so the measured-peak refit in #2239 can take it without restating the number; #2239 is not edited. This is a build-correctness fix, not a perf change: it can make the gate start fewer compilers for a giant shape, never more, and it claims no build-time gain. Why 360 and not the rounded 339: 339 comes from the 6.6 MB file size shown by the probe. On the parsed 6.2449 MB largest function it charges 2,831 MB, 114 MB short of the 2,946 MB peak; 2,848 MB is 339 at the test stand-in's 6.29 MB function. Neither reaches the peak. Read first: `mem_need` and `largest_function` in `nx2/build.py`, then the new check in `tests/test_mem_gate.py`. See #2239 (the measured-peak refit) and #362 (the earlier memory-gate formula work). AI assistance: written with an AI agent (OpenCode, DeepSeek V4.1 Flash). ## Testing **Tested:** Linux, this PC, game-free. No game run is needed: `mem_need` is read only by `MemoryGate.enter`; it is in no flag, object key, lift key or `chunks.txt` entry, so the built objects and game binary are identical with and without the change. `python -I -B tests/test_mem_gate.py` on the test-only commit `3afc8055` fails with `FAIL: a giant function's need covers its measured peak (2288 MB against 2946 MB)` (the check's 6,600,000-byte stand-in at 250 MB/MB); on the fix `487520d4` it passes: `mem_need` is 2,980 MB for that 6.294 MiB stand-in, above the 2,946 MB peak. The 2,963 MB figure is the units probe file `code_024_1.c` (6.2994 MB of C, 6.2449 MB largest function), not the stand-in. `tests/test_mem_gate_leases.py` and `tests/test_mem_limit.py` also pass. Full suite recorded at the pre-rebase head `6350aa0b` on `a2dc5385`: `mise run test -- --jobs 5` under `MemoryMax=12G`, 911 passed, 23 failed, 18 skipped in 410 s (Linux, 5 at once). All 23 failures are the `a2dc5385` baseline names: ``` nx2/test_import_windows.py tests/test_close_waits_for_save.py tests/test_compile_zero_byte.py tests/test_cpm_discovery.py tests/test_damaged_rom_files.py tests/test_dev_packs.py tests/test_draw_stream_visibility.py tests/test_fs_save_commit.py tests/test_fsr_uniform_ownership.py tests/test_guest_copies.py tests/test_hold_toggle.py tests/test_lower_atomg_cas.py tests/test_menu_i18n.py tests/test_menu_keys.py tests/test_menu_slider_ends.py tests/test_mise_build.py tests/test_pads_after_menu.py tests/test_recording_admission.py tests/test_sim_turf_pools.py tests/test_sim_turf_settings.py tests/test_switch_table.py tests/test_tls_objects.py tests/test_vibration_menu.py ``` The head is a byte-identical rebase of `nx2/build.py` and `tests/test_mem_gate.py` onto `8aa5ab87`, which includes `fe1c437c` (#2213) that rewrote 17 of the 23 named files and reports `main` back to one failure (`test_dev_packs`). The suite has now run at this head: `942 passed, 19 failed, 18 skipped in 405 s (linux, 5 at once)`, its 19 failures exactly the CORE ids of SUITE-COMPARISON-RULE's Amendment 1 table; see the `mise run test` box. **Still to test:** - A build-level comparison of the gate's admitted compilers on a memory-tight PC, by hand: expecting the giant's charge to rise to 2,963 MB and no more compilers to start for that shape. - Windows: `python -I -B tests/test_mem_gate.py` by hand or CI, expecting the same pass; the formula is platform-independent. No farm request is needed for a game-free check. ## Measurements **Verdict:** the estimate now covers the measured giant: 2,276 MB before against a 2,946 MB peak (1.29× under), 2,963 MB after (0.6% over). This is an estimate correction, not a speed gain; no build wall-clock A/B was run. Setup: Linux, clang 23, the units run's lift, one compiler at a time, the compiler tree's peak RSS. The file is the units run's `code_024_1.c` (6.2994 MB of C, largest function 6.2449 MB). | | Before: main @ 753fb5af | After: this PR @ 487520d4 | |---|---|---| | estimate for `code_024_1.c` | 2,276 MB | 2,963 MB | | measured peak for the same file | 2,946 MB | 2,946 MB | | estimate minus peak | -670 MB (1.29× under) | +17 MB (0.6% over) | `git diff a2dc5385..753fb5af -- nx2/build.py tests/test_mem_gate.py` is empty, and `mem_need` has the same body at `753fb5af` and `8aa5ab87` (sha256 `891f106ee27a4663f0009f240c08d20dc80d15ac55d60411e6eb4c44321357a6`; `tests/test_mem_gate.py` is unchanged between them), so the 2,276 MB before value computed at `a2dc5385` is exactly what current main (`8aa5ab87`) computes. The estimate and the focused check are base-independent; the suite is the part that moved (`fe1c437c` rewrote 17 of the 23 named files), and it has now run at this head, as Testing says. No build A/B: the change only moves the gate's admission for a shape with a large function; it does not change the compile, the objects or the binary. A build with the same jobs and free memory may start the same number of compilers; the fix is that a giant is no longer under-reserved. The fix's measurement is the test: `3afc8055` fails on `main` (`2288 MB against 2946 MB`) and `487520d4` passes (2,980 MB for the check's 6,600,000-byte stand-in; the probe's 2,963 MB is the table above); the focused check passes again at the rebased head. No build-time or size A/B is claimed; this estimator change cannot make a build faster and may start fewer compilers. ## Risks - What could break: a larger charge for a file with a large function can make the gate start fewer compilers on a memory-tight PC, which can lengthen a build. Only chunks with a large function move much; ordinary units with small functions move by a few MB. The gate is safer, not faster. - Turning it off: revert the constant and the one line that uses it; there is no switch, saved data or cache key. - After updating: saves, `longshot_options.ini`, the shader cache and the pipeline cache are untouched. Only the build's memory estimate changes. - Cost: a giant now reserves up to about 110 MB/MB more. In the units build's free memory the giant compiled at most one at a time; the gate does not itself cap it at one — `fits` admits a second 2,963 MB compile once 7,462 MiB is free (2 × 2,963 + 1,536). ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. The merge base is `8aa5ab876d7cc3d5a19850f3cf7f29b2172c1863`, which is current `main`, and head `e0e7315c` is that plus this PR's two commits (`28f710b9` the check, `e0e7315c` the fix). One topic: `git diff --stat origin/main...HEAD` is `nx2/build.py` 9 lines and `tests/test_mem_gate.py` 9 lines (2 files, +15/−3), the giant function's memory estimate and its check; the title is `fix(build): ...`. No rebase remains: the head already contains `main`. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. (N/A: build tooling; the game binary and objects are identical, as Testing explains.) - [x] `mise run test` passes (any failure that also fails on `main` is named). Suite at `e0e7315c5374ae4d2dedeba0a83525c7f7549121`: 942 passed, 19 failed, 18 skipped in 405 s (linux, 5 at once), exit 1. All 19 failures are CORE ids in SUITE-COMPARISON-RULE's Amendment 1 table and carry their recorded exception classes (`tests/test_amd_subgroup_profiles.py`, `tests/test_appimage_package_retry.py`, `tests/test_cpm_discovery.py`, `tests/test_crt_options.py`, `tests/test_dev_packs.py`, `tests/test_flat_map.py`, `tests/test_guest_holes.py`, `tests/test_menu_save_atomic.py`, `tests/test_menu_text_field.py`, `tests/test_nonuniform_image_arrays.py`, `tests/test_pipeline_share.py`, `tests/test_rdna2_mesh_only.py`, `tests/test_readback_timeout_source.py`, `tests/test_rumble_menu.py`, `tests/test_shader_profile_caps.py`, `tests/test_target_image_reuse.py`, `tests/test_vibration_menu.py`, `tests/test_vram_compact.py`, `tests/test_wb_spans.py`). No id outside CORE ∪ FLAKY failed, and the five FLAKY ids (`tests/test_crash_record.py`, `tests/test_seed_reader.py`, `tests/test_program_cache_reader.py`, `tests/test_audio_source.py`, `tests/test_heart_containers.py`) all passed here. Counts are not compared (Amendment 1). Log `prrefresh-logs/suite-2248-e0e7315c.log`, sha256 `4e056e1b1cde18ded572c26b2877ad5102d8373bea729adf34646e03ceb04f3c`; the JUnit reconciles (979 = 961 ran + 18 skipped; 942 + 19 = 961) and the skip set is identical. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. (Both commits now carry `Assisted-by: DeepSeek V4.1 Flash`; the tree hashes are unchanged.) ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
The mem_need probe of the giant shape (code_024_1.c: 6.30 MB of C, a 6.25 MB function) measured 2,946 MB at its peak, while the formula charges 2,276 MB at 250 MB/MB of the largest function. The stand-in has the same shape, so this fails on main for the under-estimate.
perf(build): the giant function's estimate covers its measured peak
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
909a15f473
The probe's giant (code_024_1.c: 6.30 MB of C, a 6.245 MB function) peaked at 2,946 MB. At 250 MB per MB of the largest function the formula charged 2,276 MB, 1.29x under; at 360 it charges 2,963 MB, just over. The coefficient is a named constant so #2239's measured-peak refit can take it without restating the number.
dazemc force-pushed mem-need-giant from 909a15f473
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 6350aa0b69
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 25s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-22 12:43:49 +00:00
Compare
Author
Contributor

Both commits amended with Assisted-by: DeepSeek V4.1 Flash and force-pushed with lease; new head 6350aa0b (test cfaa1d19). Tree content unchanged; focused game-free tests pass. The mise run test box stays unticked until the full suite runs behind #2239 A/B and #2207 suite.

Both commits amended with Assisted-by: DeepSeek V4.1 Flash and force-pushed with lease; new head 6350aa0b (test cfaa1d19). Tree content unchanged; focused game-free tests pass. The mise run test box stays unticked until the full suite runs behind #2239 A/B and #2207 suite.
Author
Contributor

Full suite at 6350aa0b: mise run test -- --jobs 5 under MemoryMax=12G, 911 passed, 23 failed, 18 skipped in 410 s; all 23 failures are the a2dc5385 baseline names, listed in Testing. The mise run test box is ticked; checking the ready state.

Full suite at 6350aa0b: mise run test -- --jobs 5 under MemoryMax=12G, 911 passed, 23 failed, 18 skipped in 410 s; all 23 failures are the a2dc5385 baseline names, listed in Testing. The mise run test box is ticked; checking the ready state.
Author
Contributor

Wording only: the Windows game-free check needs no farm request; the suite result and all ticked boxes are unchanged. Marking ready next.

Wording only: the Windows game-free check needs no farm request; the suite result and all ticked boxes are unchanged. Marking ready next.
dazemc changed title from WIP: perf(build): the giant function's estimate covers its measured peak to perf(build): the giant function's estimate covers its measured peak 2026-11-22 13:13:09 +00:00
Author
Contributor

perf(build) with no measured build gain. The title type is perf, whose standard is "faster, or less memory" (docs/dev/standards.md → Titles), but this raises the gate's estimate (2,276 → 2,963 MB) and its own Risks says it can make the gate start fewer compilers. Measurements says "This is an estimate correction, not a speed gain; no build wall-clock A/B was run." For a build change the Measurements table asks for build time and size on main and with this PR; the numbers here are the estimator against the compiler's peak RSS (tests/test_mem_gate.py:46-52), not that. Either retitle to fix(build) — the test-only commit cfaa1d19 already fails on main and passes here, which is the fix measurement — or add the clean-build time/size A/B and state the cost. The formula that changed is nx2/build.py:1009-1025.

**perf(build) with no measured build gain.** The title type is `perf`, whose standard is "faster, or less memory" (`docs/dev/standards.md` → Titles), but this raises the gate's estimate (2,276 → 2,963 MB) and its own Risks says it can make the gate start fewer compilers. Measurements says "This is an estimate correction, not a speed gain; no build wall-clock A/B was run." For a build change the Measurements table asks for build time and size on `main` and with this PR; the numbers here are the estimator against the compiler's peak RSS (`tests/test_mem_gate.py:46-52`), not that. Either retitle to `fix(build)` — the test-only commit `cfaa1d19` already fails on `main` and passes here, which is the fix measurement — or add the clean-build time/size A/B and state the cost. The formula that changed is `nx2/build.py:1009-1025`.
dazemc changed title from perf(build): the giant function's estimate covers its measured peak to fix(build): the giant function's estimate covers its measured peak 2026-11-22 13:44:10 +00:00
Author
Contributor

Quality comment 73202: retitled to fix(build) and removed the perf claim. This is a build-correctness fix; its measurement is cfaa1d19 failing on main (2288 against 2946 MB) and 6350aa0b passing (2,963 MB). No build-time or size A/B is claimed; head and code are unchanged.

Quality comment 73202: retitled to fix(build) and removed the perf claim. This is a build-correctness fix; its measurement is cfaa1d19 failing on main (2288 against 2946 MB) and 6350aa0b passing (2,963 MB). No build-time or size A/B is claimed; head and code are unchanged.
Author
Contributor

The title and body are now fix(build) with no performance claim; the kind/performance label is stale and needs removal/replacement before merge. Evidence: cfaa1d19 fails on main (2288 against 2946 MB), 6350aa0b passes (2,963 MB), and the full suite is 911 passed / 23 failed / 18 skipped, all 23 failures in the a2dc5385 baseline.

The title and body are now fix(build) with no performance claim; the kind/performance label is stale and needs removal/replacement before merge. Evidence: cfaa1d19 fails on main (2288 against 2946 MB), 6350aa0b passes (2,963 MB), and the full suite is 911 passed / 23 failed / 18 skipped, all 23 failures in the a2dc5385 baseline.
dazemc force-pushed mem-need-giant from 6350aa0b69
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 25s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 487520d410
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 23s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-22 20:32:43 +00:00
Compare
Author
Contributor

Rebased onto 753fb5af; no code change; new head 487520d4 (test 3afc8055). The focused check passes at the new head; the pre-rebase suite evidence still holds because the diff is unchanged.

Rebased onto 753fb5af; no code change; new head 487520d4 (test 3afc8055). The focused check passes at the new head; the pre-rebase suite evidence still holds because the diff is unchanged.
Author
Contributor

Rebased head 487520d4 is still ready and waits only on fork CI: its 10 pull_request jobs are "Blocked by required conditions" and the PR has no ci: approved label. No earlier fork-CI ask names this head.

@HumanBean: please approve this head's fork CI runs (the Actions jobs, and the ci: approved label for the fork project) and review #2248 — the giant function's estimate covers its measured peak.

Evidence is in the thread, not re-posted: tests/test_mem_gate.py fails on main (2,288 against 2,946 MB) and passes here (2,963 MB), and the 20:34 comment has the focused check at the new head. The description still warns that it was measured on main a2dc5385; its CI passes on the head; on current main, measured again box needs that re-check.

Rebased head `487520d4` is still ready and waits only on fork CI: its 10 `pull_request` jobs are "Blocked by required conditions" and the PR has no `ci: approved` label. No earlier fork-CI ask names this head. @HumanBean: please approve this head's fork CI runs (the Actions jobs, and the `ci: approved` label for the fork project) and review #2248 — the giant function's estimate covers its measured peak. Evidence is in the thread, not re-posted: `tests/test_mem_gate.py` fails on `main` (2,288 against 2,946 MB) and passes here (2,963 MB), and the 20:34 comment has the focused check at the new head. The description still warns that it was measured on `main` `a2dc5385`; its `CI passes on the head; on current main, measured again` box needs that re-check.
Author
Contributor

Read-only audit of head 487520d4 (nothing built or run). The code reads sound: mem_need has one reader, MemoryGate.enter (nx2/build.py:1014, :1072), so the built objects and binary are unchanged and the game-test N/A is right; the estimate arithmetic checks out (int(400 + 50*6.2994 + 360*6.2449) = 2963, against 2276 at 250), and the new check at tests/test_mem_gate.py:46-52 fails on main at 2288 for the 250 coefficient, which is the reason it targets. The gaps are evidence and description, not code.

1. The mise run test box is stale against the rebased base. It rests on 6350aa0b (base a2dc5385), but the head is on 753fb5af. Main's fe1c437c (#2213, "the checks main's last commits left stale pass again") is one of the 10 commits between those bases, and it edited 17 of the 23 named failing test files; its message says it brings the suite back to one failing check, test_dev_packs. The "diff is unchanged" argument in the 20:34 comment covers nx2/build.py and tests/test_mem_gate.py (they are indeed identical between 6350aa0b and 487520d4), not the 17 test files #2213 rewrote. So the 23 names are the a2dc5385 baseline, not the 753fb5af one. What would settle it: a suite run at 487520d4, or a comment naming the 753fb5af baseline (with any failures there) and why the 23 names still apply; then tick the box. Until then the box is not evidence for this head.

2. The base warning is material for the suite, not for the estimate. git diff a2dc5385..753fb5af -- nx2/build.py tests/test_mem_gate.py is empty, so 2,276 is exactly what current main computes; Measurements can say that instead of "the diff is unchanged", which clears the pr status warning for the number. The part that moved is the suite.

3. "339 charges about 2,848 MB" does not follow from the parsed size. int(400 + 50*6.2994 + 339*6.2449) = 2831 MB, 114 MB short, not 2,848/~100. 2,848 is 339 at 6.29 (the test stand-in's size). Restate 2,831/114, or say the 2,848 is the stand-in. It does not change 360 (2,963).

4. The Testing sentence "on the fix 487520d4 it passes (mem_need 2,963 MB)" mixes the probe with the test stand-in. The check writes 6,600,000 bytes, a ~6.294 MiB function, so its message would read 2,980, not 2,963; 2,963 is code_024_1.c. Say which file each number is.

Minor: kind/performance is still on the PR although the title is fix(build) (the 13:46 comment says it needs removing); and "On this PC's 15.5 GB the giant compiles at most one at a time" is not what fits enforces — two 2,963 MB compiles fit above about 7.3 GiB free (nx2/build.py:1062-1069), so if that is what the units build showed, say that. What would settle it: the free_mb samples from that build.

Ready to merge: all four are correctly unticked; CI on 487520d4 is 1 passed / 10 pending ("Blocked by required conditions"), and the ci: approved ask is in the 22:44 comment.

Read-only audit of head `487520d4` (nothing built or run). The code reads sound: `mem_need` has one reader, `MemoryGate.enter` (`nx2/build.py:1014`, `:1072`), so the built objects and binary are unchanged and the game-test N/A is right; the estimate arithmetic checks out (`int(400 + 50*6.2994 + 360*6.2449) = 2963`, against 2276 at 250), and the new check at `tests/test_mem_gate.py:46-52` fails on main at 2288 for the 250 coefficient, which is the reason it targets. The gaps are evidence and description, not code. **1. The `mise run test` box is stale against the rebased base.** It rests on 6350aa0b (base `a2dc5385`), but the head is on `753fb5af`. Main's `fe1c437c` (#2213, "the checks main's last commits left stale pass again") is one of the 10 commits between those bases, and it edited 17 of the 23 named failing test files; its message says it brings the suite back to one failing check, `test_dev_packs`. The "diff is unchanged" argument in the 20:34 comment covers `nx2/build.py` and `tests/test_mem_gate.py` (they are indeed identical between 6350aa0b and 487520d4), not the 17 test files #2213 rewrote. So the 23 names are the `a2dc5385` baseline, not the `753fb5af` one. What would settle it: a suite run at `487520d4`, or a comment naming the `753fb5af` baseline (with any failures there) and why the 23 names still apply; then tick the box. Until then the box is not evidence for this head. **2. The base warning is material for the suite, not for the estimate.** `git diff a2dc5385..753fb5af -- nx2/build.py tests/test_mem_gate.py` is empty, so 2,276 is exactly what current main computes; Measurements can say that instead of "the diff is unchanged", which clears the `pr status` warning for the number. The part that moved is the suite. **3. "339 charges about 2,848 MB" does not follow from the parsed size.** `int(400 + 50*6.2994 + 339*6.2449) = 2831` MB, 114 MB short, not 2,848/~100. 2,848 is 339 at 6.29 (the test stand-in's size). Restate 2,831/114, or say the 2,848 is the stand-in. It does not change 360 (2,963). **4. The Testing sentence "on the fix 487520d4 it passes (`mem_need` 2,963 MB)" mixes the probe with the test stand-in.** The check writes 6,600,000 bytes, a ~6.294 MiB function, so its message would read 2,980, not 2,963; 2,963 is `code_024_1.c`. Say which file each number is. Minor: `kind/performance` is still on the PR although the title is `fix(build)` (the 13:46 comment says it needs removing); and "On this PC's 15.5 GB the giant compiles at most one at a time" is not what `fits` enforces — two 2,963 MB compiles fit above about 7.3 GiB free (`nx2/build.py:1062-1069`), so if that is what the units build showed, say that. What would settle it: the `free_mb` samples from that build. Ready to merge: all four are correctly unticked; CI on `487520d4` is 1 passed / 10 pending ("Blocked by required conditions"), and the `ci: approved` ask is in the 22:44 comment.
Author
Contributor

Description corrected against the read-only audit (no code, no head change; head stays 487520d4 on 753fb5af).

  • Suite: the 911 passed / 23 failed / 18 skipped record is now labelled as the a2dc5385 baseline at 6350aa0b; fe1c437c (#2213) rewrote 17 of the 23 named files and reports main back to one failure (test_dev_packs), and the suite was not re-run at the head.
  • 339: on the parsed 6.2449 MB function it charges 2,831 MB, 114 MB short of the 2,946 MB peak; 2,848 MB is 339 at the test stand-in's 6.29 MB function.
  • Test numbers: the check's 6,600,000-byte stand-in passes at 2,980 MB; 2,963 MB is the code_024_1.c probe.
  • Base: git diff a2dc5385..753fb5af -- nx2/build.py tests/test_mem_gate.py is empty, so the 2,276 MB before estimate and the focused check are base-independent; the suite is the part that moved. The Measurements before column now says 753fb5af, with that provenance.
  • Risks: the one-at-a-time sentence is scoped to the units build's free memory; fits itself admits a second 2,963 MB compile once 7,462 MiB is free.
  • Label: kind/performance is stale for a fix(build) with no perf claim; it should be kind/bug. I could not change it — this account has read access to the repo (the label DELETE returns 403) — so a maintainer needs to make the change.

The 22:44 CI ask still names this head 487520d4.

Description corrected against the read-only audit (no code, no head change; head stays `487520d4` on `753fb5af`). - **Suite:** the 911 passed / 23 failed / 18 skipped record is now labelled as the `a2dc5385` baseline at `6350aa0b`; `fe1c437c` (#2213) rewrote 17 of the 23 named files and reports `main` back to one failure (`test_dev_packs`), and the suite was not re-run at the head. - **339:** on the parsed 6.2449 MB function it charges 2,831 MB, 114 MB short of the 2,946 MB peak; 2,848 MB is 339 at the test stand-in's 6.29 MB function. - **Test numbers:** the check's 6,600,000-byte stand-in passes at 2,980 MB; 2,963 MB is the `code_024_1.c` probe. - **Base:** `git diff a2dc5385..753fb5af -- nx2/build.py tests/test_mem_gate.py` is empty, so the 2,276 MB before estimate and the focused check are base-independent; the suite is the part that moved. The Measurements before column now says `753fb5af`, with that provenance. - **Risks:** the one-at-a-time sentence is scoped to the units build's free memory; `fits` itself admits a second 2,963 MB compile once 7,462 MiB is free. - **Label:** `kind/performance` is stale for a `fix(build)` with no perf claim; it should be `kind/bug`. I could not change it — this account has read access to the repo (the label DELETE returns 403) — so a maintainer needs to make the change. The 22:44 CI ask still names this head `487520d4`.
dazemc changed title from fix(build): the giant function's estimate covers its measured peak to WIP: fix(build): the giant function's estimate covers its measured peak 2026-11-23 01:07:14 +00:00
dazemc force-pushed mem-need-giant from 487520d410
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 23s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to e0e7315c53
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 14s
2026-11-24 05:25:47 +00:00
Compare
Author
Contributor

@HumanBean — fork CI for head e0e7315c, please.

What it is: mem_need's giant-function estimate now covers its measured peak (2,276 MB estimated against 2,946 MB measured).
Asked: approve this head's fork CI runs, and a review when you have the time.
Evidence: Measurements' verdict at this tree, and the suite recorded at 6350aa0b on a2dc5385 (911/23/18, all 23 the baseline names).
Still WIP — suites land one at a time, so this is not a merge request.

@HumanBean — fork CI for head `e0e7315c`, please. **What it is:** `mem_need`'s giant-function estimate now covers its measured peak (2,276 MB estimated against 2,946 MB measured). **Asked:** approve this head's fork CI runs, and a review when you have the time. **Evidence:** Measurements' verdict at this tree, and the suite recorded at `6350aa0b` on `a2dc5385` (911/23/18, all 23 the baseline names). Still WIP — suites land one at a time, so this is not a merge request.
dazemc changed title from WIP: fix(build): the giant function's estimate covers its measured peak to fix(build): the giant function's estimate covers its measured peak 2026-11-24 13:22:28 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 14s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'mem-need-giant:dazemc-mem-need-giant'
git switch 'dazemc-mem-need-giant'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2248
No description provided.