Repository navigation
build(libobs): record the libobs build phases for the module-cache baseline (#3257) - #3294
Conversation
zackees
left a comment
There was a problem hiding this comment.
Coordinator review. One real finding, plus one cleanup.
- The cold oracle number comes from a failed build. In
docs/rust-port/benchmarks/libobs-modules-baseline.json,initial_oraclehas"returncode": 101and astderr_tailthat ends insoldr: pruned 253 orphan .rmeta file(s) ... after failed cargo build. The PR body's "365 s (cold, host)" oracle figure is that sample's wall time, so it measures a build that failed partway, not a cold oracle build. Either rerun until it exits 0, or drop the number and mark it unmeasured. Also make the script fail, or at least mark a sample"ok": falseand leave it out of the medians, when any timed command exits non-zero. Thesoldr cargo build -p obs-c-oraclecall issubprocess.run(...)with nocheck, so a broken build gets recorded as a timing. (The per-case oracle samples I spot-checked all showreturncode: 0.) - Local paths are committed. The same
stderr_tailcontains absolute paths under/home/<user>/dev/obs-rust/obs-studio3/and~/.soldr/. Once the failed sample is gone this goes too. Otherwise, store at most the tail's last line, with paths made relative to the repo root.
The rest is sound. Restoring the edited file byte for byte in finally, and doing an untimed rebuild between samples, keeps the tree clean and the samples independent. The conclusions for #3256 follow from the other cases: the Rust staticlib dominates, which makes #3265 the biggest win, and the PCH edit recompiles 4 of 11 groups. They don't depend on the bad oracle number.
|
Coordinator: the Fast Gate failure is in this PR's own code. Ruff |
What
rust/tools/benchmarks/libobs_build_phases.py(uv script) configures a libobs-only tree, builds it cold, then for each edit case appends an inert change to one tracked file, rebuilds, and restores the file byte for byte. The cases are no change,libobs/obs.c.h,libobs/build/libobs.pch.h, a ported-source-set.json, andrust/obs-util/src/lib.rs. Each sample records:.ninja_logentry the build appended, attributed to its unity group, the libobs link or the Corrosion/cargo step;--oracle-onlycovers a host without the libobs C deps;--no-oraclecovers the container. Every build(libobs): tracker — decentralized lib-modules in a content-addressed artifact cache, relinked into libobs #3256 sibling reruns this script for its "after" numbers.docs/rust-port/benchmarks/libobs-modules-baseline.json: 3 samples per case.Baseline (Linux, medians; Ryzen 7 3700X, load average 10-20)
.c.hlibobs.pch.h.jsonWhat it says for #3256
libobs.pch.hedit recompiles 4 of the 11 groups (16.6 s CPU), which is build(libobs): narrow per-module precompiled headers #3260's target.libobs/edit, even the ported.json, which never touches the hybrid build. That is build(obs-c-oracle): link the cached libobs modules instead of recompiling libobs C #3263's target.Not covered
cmake/crossneeds SDKs that this host doesn't have. They are left for a host or CI run, and build(libobs): instrument the libobs build phases for the module-cache baseline #3257 stays open for them (Refs).obs-rust-linux-validateimage, because this NixOS host lacks ECM and the other C deps. The oracle timings ran on the host.RED → GREEN
ci/test_libobs_build_phases.pyfails with no recorder../lintpasses.Test cost: five Python tests, about 1 ms, no threads.
Refs #3257. Refs #3256.