Skip to content

docs(build): finish the off-cycle compile audit, removing nothing - #7602

Merged
kixelated merged 8 commits into
mainfrom
quest/m1/prune-build-time
Nov 2, 2026
Merged

kixelated merged 8 commits into
mainfrom
quest/m1/prune-build-time

Conversation

@kixelated

@kixelated kixelated commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

quest/m1/prune-build-time.md is a one-off, off-cycle run of the recurring compile-time audit. It defaults to removing whatever dominates dev, release, and incremental build time, and records before and after numbers. This PR finishes it.

Approach

  • Refresh the recurring audit (quest/m2/audit-compile-time.md) with six-target IR baselines, cold dev/release builds, owned script and macro costs, the rejected reader candidates, the shipping-profile LTO comparison, the 72-case paired session benchmark, and a real mbx incremental edit. Raw data and exact candidate patches are in compile-time-audit.json.
  • mbx incremental edit: append a comment to rs/moq-net/src/lib.rs three times, then revert it. Each edit rebuilds the same 26 dependent units. Through mbx, once incremental state exists, an edit costs 99.0 G instructions, 24 to 26 s CPU, and 12 to 14 s wall. Plain Cargo (MBX_DISABLE=1, incremental = false) costs 450 G every time (-78% for mbx). The first edit through mbx costs 538 G (+20%) while it records that state. In a warm edit the five final binaries are 49 to 53% of unit time. moq-net itself takes about 2.3 s.
  • Drop the MP4 reader consolidation. It removes 10 lib IR lines, grows the test IR by 904, and leaves rebuild instructions flat. mp4-atom's own decoders still need both slice variants.
  • Keep fat LTO, for now. Rerun from equally cold targets (the first comparison built fat into a target the default release build had already filled, so 300 of its 474 units timed at 0 s), the shipping OpenH264 FFI build favors thin: whole-command wall 465.5 → 407.1 s (-12.5%) at about equal CPU (653.4 → 664.3 s), final unit 162.6 → 114.9 s, archive 62.4 → 71.4 MiB (+14.5%). Session CPU thin/fat geometric mean is 1.034, which is noise. Fat stays as the maintainer's 2026-10-20 choice: release builds are still off the PR gate, so the saving lands only on the release workflows, while m0 measured 1.6 to 2.1% more session instructions under thin. The audit now states this rather than a build-cost claim.
  • Workspace-hack: moq-dev/moq#6985 landed after the measured base, so the audit flags which baselines it can shift and points feature-unification work at the open hakari quest.
  • Retain owned crates, kio macros, platform aliases, config parsers, and binding generators, since each serves a current consumer. Trimming moq-bench or moq-studio from default-members would only shorten a bare root cargo build, because CI and just select packages or pass --workspace. No public feature removal is proposed.
  • The quest is finished: deleted along with its link from the m1 README. The recurring audit keeps its schedule, and no successor is created.

Coordination

  • Dependency replacements remain with moq-dev/moq#7601 and test pruning with moq-dev/moq#7600. Feature unification (moq-dev/moq#6985), the slow-test cohort (moq-dev/moq#6987), and the mbx E2BIG fix (moq-dev/moq#7594) have since merged.
  • moq-dev/moq#6985 landed after this run's measured base (21d6da9fc1), so the recorded baselines predate the workspace-hack. The audit now says so, notes which rows it can shift (only builds with dev-dependencies, such as the mux test-profile IR count), and points feature-unification work at the still-open hakari quest instead of the merged PR.

Impact

  • Public API and wire: none.
  • Production behavior, dependencies, tests, and release profile: unchanged. Docs and quest files only.

Alternatives

  • Keep a cursor refactor for ten IR lines: rejected as churn without a measured benefit.
  • Switch to thin LTO for the faster final unit: rejected, since the whole build and the runtime measurements do not justify it.
  • Trim default-members: rejected, since it only affects a bare root build.

Choices made without asking, for review: keeping fat LTO and the current readers, and finishing the quest with no removal. Note that the 2026-10-20 LTO decision said "keep fat LTO until the archive shrinks": the archive has shrunk (m0's fat Go-mirror archive was 71.2 MiB; fat libmoq_ffi.a is 62.4 MiB here) and thin now wins on cold wall time, so switching to thin is a fair question for the maintainer. This PR keeps fat because the runtime cost stays unresolved and release builds stay off the PR gate.

Checks

Run on head 46314474ff (after merging origin/main):

  • quest gate nix develop --command just ci origin/main: exit 0. Selected modules: check markdown, check gh, test gh, check quest, check shell, large_files, toml, nix, justfile. This docs-only diff selects no Rust, JS, or flake module.
  • quest check --base origin/main and git diff --check: pass.
  • LTO rerun: cargo build-ffi --release --timings at base 21d6da9fc1, fat then thin, each into its own fresh CARGO_TARGET_DIR, with MBX_DISABLE=1, CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, under quest gate. Both exited 0 with identical 474-unit sets.
  • The earlier mbx incremental probe ran through the real mbx Cargo shim with moq-dev/moq#7594's PATH dedupe, now merged.

Review

  • Reviewer: Codex, gpt-6.1-sol, medium effort (quest review --base origin/main, session 01a19d5c-22f6-7d03-bdc1-3911cab3964b).
  • Reviewed head: 46314474ff7bdc88ca03a8407f02258b30ce45f8 (round 2).
  • Round 1 (head fa1f1bec22, after the main merge): one finding, fixed. "Equalize cache state before comparing whole-build LTO costs": the fat run had 300 of 474 units timed at 0 s. Both profiles were rerun from fresh targets and the prose, table, and JSON replaced; the old run's summary is kept under shipping_lto.superseded.
  • Round 2: no findings.
  • Posted reviews on 84ae577c87 (OpenAI review, Pullfrog) reported nothing actionable; CodeRabbit was rate-limited.

Follow-ups

  • Possible quest: warm incremental edits are now about half final-binary codegen and link (moq, moq-studio, moq-bench, moq-relay). A future audit could measure whether the linker or the binaries' own codegen dominates. Not planned here.

(Written by Claude Opus 5.5)

The MP4 reader candidate changes library IR by only ten lines, grows test IR by 904, and leaves rebuild CPU and instructions flat. Preserve the measured patches and keep production readers unchanged.

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Thin reduces the final FFI unit from 135.70 to 88.04 seconds, but the whole command uses 547.74 rather than 390.19 CPU seconds for the same 474 units. The archive grows from 62.4 to 71.4 MiB, and the paired session benchmark establishes no runtime win.

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated kixelated changed the title Remove what dominates build time docs(build): checkpoint compile audit and rejected optimizations Nov 2, 2026
kixelated and others added 2 commits November 1, 2026 22:21
…uest

A one-line moq-net edit through mbx rebuilds the same 26 units as plain
Cargo in 99 G instructions against 450 G once incremental state exists;
the first edit costs 538 G while recording it. Final binaries are about
half of a warm edit. Nothing is removed, so the off-cycle quest finishes
and its checkpoint becomes the audit's results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title docs(build): checkpoint compile audit and rejected optimizations docs(build): finish the off-cycle compile audit, removing nothing Nov 2, 2026
@kixelated
kixelated marked this pull request as ready for review November 2, 2026 06:44
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f74fa9db-df24-4aee-aa8f-6ca114c482c3
Commits

Reviewing files that changed from the base of the PR and between 96244dd and 4631447.

Files selected for processing: 4
  • .github/compile-time-audit.json
  • quest/m1/README.md
  • quest/m1/prune-build-time.md
  • quest/m2/audit-compile-time.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: 84ae577.

No actionable bugs found. Keeping the existing readers and fat LTO is a reasonable, simpler outcome: the retained data supports rejecting the reader consolidation, separates final-unit timing from whole-build cost, and distinguishes first-edit incremental setup from warm edits. The recurring audit remains intact after removing the one-off quest.

Verification: static review of the documentation and recorded measurements; checked the headline timing totals and recomputed the 72-case runtime geometric mean from the JSON. I did not reproduce the builds, run tests, or execute benchmarks, so this does not independently validate the recorded measurements.

(Written by OpenAI)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Docs/quest-only PR that finishes the off-cycle compile-time audit; no production code, dependencies, tests, profile, API, or wire change.

  • New measurement record (.github/compile-time-audit.json): raw environment, llvm-lines tables, dev/release --timings unit data, reader-candidate patches, shipping-LTO comparison, and the mbx incremental probe.
  • Recurring audit refreshed (quest/m2/audit-compile-time.md): rewritten "what to check first" bullets plus an "Off-cycle run (2026-11-01)" section; the old baselines section is retitled "Historical baselines".
  • Quest finished: quest/m1/prune-build-time.md deleted and its index bullet removed from quest/m1/README.md.

I spot-checked the prose against the JSON: the six-target IR table, cold dev/release wall/CPU/unit durations, the fat-vs-thin LTO table (390.19→547.74 s CPU, 62.4→71.4 MiB), the 72-case session-bench geomean (1.034, range 0.747–1.403), and the mbx incremental table all match. Base SHA 21d6da9fc1 resolves, cargo build-ffi exists, the embedded reader-candidate patch passes git apply --check, #6176 is merged and #7594 is open as described, and no dangling prune-build-time references remain. No action required.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

kixelated and others added 3 commits November 2, 2026 09:29
#6985 merged after the off-cycle run's base, so point feature-unification
work at the still-open hakari quest and flag which baselines it can shift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first comparison built fat into a target the default release build had
already filled, so 300 of its 474 units were timed at 0 s. From fresh
targets thin cuts the whole build's wall by 12.5% at about equal CPU. Fat
stays for now, with the reason restated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: 4631447.

No new actionable bugs found. The cold-target rerun corrects the earlier unequal-work LTO comparison: the recorded 474 unit identities match, their durations sum to the reported totals, and the revised 12.5% wall saving, 1.7% CPU increase and 14.5% archive growth are consistent. Keeping the superseded result explicitly labeled, separating pre-hakari baselines, and leaving the shipping-profile decision unchanged is a reasonable, low-complexity outcome; the original whole-build argument for fat LTO no longer applies, as the revised guidance acknowledges.

Verification: static review of the changes since the prior review, excluding merged base changes, plus arithmetic checks against the retained JSON. I did not reproduce builds, run tests or benchmarks, or independently validate measurement conditions.

(Written by OpenAI)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Incremental re-review of the 3 commits since the last pullfrog review (84ae577c); all docs and measurement data, no production surface.

  • Cold-target LTO rerun (46314474f): rebuilt fat and thin from fresh per-profile targets, replacing the earlier comparison that had filled fat into the default-feature release target. quest/m2/audit-compile-time.md and .github/compile-time-audit.json now record fat 465.48 s / thin 407.12 s wall (-12.5%), final moq-ffi unit 162.63 s / 114.87 s (-29.4%), +1.7% CPU, archive +14.5% (both under the 100 MB ceiling). I recomputed each percentage against the JSON and they hold.
  • Superseded run preserved under shipping_lto.superseded, with the reason (300 of 474 fat units timed at 0 s; thin rebuilt them at 202.16 s) matching the prose.
  • Workspace-hack note (fa1f1bec2): the m1 baselines now flag that they predate #6985 and point feature-unification work at /quest/m0/ci/hakari.md.
  • Baseline bullet rewritten to state fat LTO is kept on the maintainer's 2026-10-20 choice (archive condition met, thin cheaper on wall) rather than on a whole-build cost claim.

The one maintainer-facing open question (fat vs thin LTO) is a future decision the PR body explicitly flags, not a defect in this diff. Both prior reviews on 84ae577c and head 46314474ff found nothing actionable.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 8699953 Nov 2, 2026
9 of 10 checks passed
@kixelated
kixelated deleted the quest/m1/prune-build-time branch November 2, 2026 20: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