Repository navigation
feat: pass siso a learned -weights_file in e build - #931
Conversation
siso weighs every step 1 by default, so it schedules deep chains of cheap steps ahead of the real critical path (the v8 snapshot/link tail). e build now passes -weights_file from $ELECTRON_SISO_WEIGHTS_FILE (0 disables), the out dir's siso_weights.json.gz, or a shipped per-platform seed, in that order, unless the user passed their own. After each successful siso build it merges siso_metrics.json into the out dir's learned file. Weights only change ordering; outputs and cache hits are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KX1hkJiLW12nFkkahP1BKb
siso added -weights_file and $SISO_WEIGHTS_FILE together (c961df82, 2026-10-29), with the env var as the flag's default. The siso pinned by Electron 45-x-y and older predates it and would reject the flag, failing every build once a learned file exists, but ignores the env var. Set SISO_WEIGHTS_FILE in the build env instead, unless the user set it or passed -weights_file, and do it for every siso build, not only remote ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KX1hkJiLW12nFkkahP1BKb
There was a problem hiding this comment.
LGTM. The latest commit fixes both points from my earlier review. Weights now reach siso through SISO_WEIGHTS_FILE rather than a -weights_file flag, and weightsEnv runs for --no-remote builds as well.
What was reviewed:
runNinjaenv handling:RBE_remote_disabledis now added to the weights env instead of replacing it, anddepot.spawnstill layers it over process and config env.- Override precedence in
weightsEnv: a user-passed-weights_file/--weights_fileor an existingSISO_WEIGHTS_FILEin the shell or config wins. updateLearnedWeights: catches all errors, writes via tmp then rename, and skipsno_exec, failed and inverted-timing entries.- Not checked: whether older pinned siso versions really ignore
SISO_WEIGHTS_FILE. The checkout can't settle that. If they do ignore it, the only effect is an unweighted build.
Extended reasoning...
The change adds src/utils/siso-weights.ts (~160 lines), wires it into runNinja in src/e-build.ts, and adds README docs and unit tests. It has no security-sensitive surface: it sets one env var on the build subprocess and writes a gzip file into the user's own out dir. The new code catches all of its own errors, and weights only affect the order siso schedules steps in. The follow-up commit 6722bb8 fixes both issues from the earlier automated review: the flag no longer breaks older siso, and local-only builds now get weights. A maintainer had already approved, and no other reviewer has an open objection.
Brings in #931 (siso weights) and #933 (clang-coverage cross-clang routing). e-build.ts: the siso spawn env now carries both GOGC=200 (siso.buildEnv) and SISO_WEIGHTS_FILE (weightsEnv) for every siso build, each with its own user overrides. main.star: keep #933's is_clang_rule alongside this branch's rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KX1hkJiLW12nFkkahP1BKb
Requested via Slack thread
e buildnow passes siso a weights file that records how long each step took in an earlier build. siso uses it to schedule the real critical path, the v8 snapshot and link tail, earlier, where today it treats every step as weight 1. The file is the first of these that exists:ELECTRON_SISO_WEIGHTS_FILE, the out dir'ssiso_weights.json.gz, or a shipped per-platform seed. The out dir file is learned: after each successful siso build,e buildmerges that build'ssiso_metrics.jsoninto it. SettingELECTRON_SISO_WEIGHTS_FILE=0turns weights off, and a-weights_filethe user passes always wins. Weights only change the order steps run in, so outputs and cache hits are identical. On the same stack as #930, clean builds went from about 168–184s to 140–158s at the same CPU. This follows up #930 but doesn't depend on its code, so it targets main. No per-platform seed files ship yet, so a fresh out dir builds unweighted until its first successful build; generating the seeds from a CI clean build is a follow-up. The merge path has been run end to end on synthetic siso metrics in the unit tests, but not on a real build.Generated by Claude Code