8000 Measure allocation windows and reject invalid profiling evidence by Tigon32 · Pull Request #140 · Tigon32/miniquad · GitHub
[go: up one dir, main page]

Skip to content

Measure allocation windows and reject invalid profiling evidence - #140

Merged
github-actions[bot] merged 1 commit into
masterfrom
feat/allocation-profile-evidence
Nov 11, 2026
Merged

github-actions[bot] merged 1 commit into
masterfrom
feat/allocation-profile-evidence

Conversation

@Tigon32
@Tigon32 Tigon32 commented Nov 11, 2026
Copy link
Copy Markdown
Owner

Purpose

Related issue: #14 (partial; keep open).

Measure Rust/WASM allocations with real counters. Reject invalid profiling evidence.

Change

Add a benchmark-only counting allocator. Share its implementation between the native experiment and the browser fixture. Do not change production allocation or rendering.

Capture allocation snapshots at exact frame boundaries. Validate signed byte deltas, adjacent windows, real framebuffer pixels, and source hashes. Reject timing builds with actual alloc_profile_ exports. Add regression tests for these faults.

Record corrected measurements and the review of not-fl3#682 and not-fl3#691. Keep superseded claims visible and identify the current results.

Delivery source: 76e4ba39d0e77610127acc91d7390ba12fe97e7a.
Base: a37a7040a076a6a9695caae0ba5ad2d2bf327b88.

Tests

Command or measurement Result
npm run ci:local Passed on 07dab430bdd75b4a2f8dc0d2bec34f1f59c6842d. Root 10, drawing 41 plus 1 doc-test, voxel 88, and Node 21 plus 219 passed. Chromium: 56 smoke cases plus 2 drawing-consumer cases passed.
cargo test --manifest-path experiments/allocation-profile/Cargo.toml -- --test-threads=1 Passed: 5 tests on macOS arm64.
cargo fmt --manifest-path experiments/allocation-profile/Cargo.toml -- --check Passed.
rustfmt --check examples/browser_perf.rs Passed.
node --test tests/*.test.cjs tests/profile-browser.test.mjs Passed: 103 tests on the final delivery tree.
node --check scripts/profile-browser.mjs Passed on the final delivery tree.
node scripts/check-docs.mjs Passed on the final delivery tree.
git diff --cached --check Passed before the delivery commit.
Real browser profiling, 3 timing pairs All 5 pixel comparisons had equal sizes, maximum channel difference 0, and mismatched-pixel ratio 0. Both allocation windows contained exactly 30 frames: 90 allocations, 0 reallocations, 90 deallocations, live-byte delta 0.

The local CI run used Linux arm64 in Docker, Chromium 141.0.7390.37, and SwiftShader. The profiling run used the shared macOS arm64 host. Measurement source: 022ca9049cd6fc3422fa7ab5360c226053f9c9e5. Receipt SHA-256: e638b35b1004550c4b5b09c88f5f2394785a8b8a5ea5741be52078f4850d8709.

All runtime source files are byte-identical to the local CI source. The delivery changes only a documentation path substitution, a current-evidence note, and one trailing blank line in a test. Historical measurement commits and raw receipts remain local; committed file hashes identify the measured code.

An earlier local CI attempt stopped with SIGPIPE; the completed rerun passed. The native allocator tests need --test-threads=1 because they observe the process-wide allocator. Earlier parallel test attempts failed. The legacy repository-wide rustfmt step also failed; the existing workflow marks it non-blocking. Formatting checks on the changed Rust files passed.

Firefox, WebKit, native graphics, mobile devices, and a dedicated reference device were not tested for this measurement. No speed gain, general leak freedom, release qualification, or production optimization is claimed.

Risk and rollback

The allocator is experimental and needs the documented build flag. Separate target directories prevent an instrumented build from replacing a timing baseline. CDP heap sampling does not attribute Rust/WASM allocation counts.

Revert this PR to remove the experiment and profiler changes. Production renderer and loader files are unchanged. Keep #14 open for its remaining acceptance conditions.

Controlled-English review

  • I used the terms in the glossary.
  • I used short sentences and direct instructions.
  • I checked the meaning of source links, numbers, and units.
  • I did not change the spelling of code, paths, commands, or test output.
  • I recorded the review state as STE-aligned draft or added evidence of a full ASD-STE100 check.

The unchecked item records the explicit replacement of a machine-local absolute path with $PLAYWRIGHT_ENTRY in public command excerpts. Test results and source hashes did not change.

See MADR 0003.

#14)

Add benchmark-only allocation counters, exact frame windows, real WASM export checks, and corrected profile evidence. No production renderer or loader change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot enabled auto-merge (squash) November 11, 2026 12:38
@github-actions
github-actions Bot merged commit 3ec7e26 into master Nov 11, 2026
3 checks passed
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

0