Skip to content

feat: pass siso a learned -weights_file in e build - #931

Merged
MarshallOfSound merged 2 commits into
mainfrom
claude/siso-weights-file
Nov 18, 2026
Merged

MarshallOfSound merged 2 commits into
mainfrom
claude/siso-weights-file

Conversation

@claude

@claude claude Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Requested via Slack thread

e build now 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's siso_weights.json.gz, or a shipped per-platform seed. The out dir file is learned: after each successful siso build, e build merges that build's siso_metrics.json into it. Setting ELECTRON_SISO_WEIGHTS_FILE=0 turns weights off, and a -weights_file the 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

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
@MarshallOfSound
MarshallOfSound marked this pull request as ready for review November 17, 2026 07:32
@MarshallOfSound
MarshallOfSound requested review from a team and ckerr as code owners November 17, 2026 07:32

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Findings marked 🟡 are optional suggestions and need no follow-up push.

Comment thread src/utils/siso.ts Resolved
Comment thread README.md Resolved
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

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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:

  • runNinja env handling: RBE_remote_disabled is now added to the weights env instead of replacing it, and depot.spawn still layers it over process and config env.
  • Override precedence in weightsEnv: a user-passed -weights_file/--weights_file or an existing SISO_WEIGHTS_FILE in the shell or config wins.
  • updateLearnedWeights: catches all errors, writes via tmp then rename, and skips no_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.

@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) November 18, 2026 07:34
@MarshallOfSound
MarshallOfSound merged commit c81cf56 into main Nov 18, 2026
14 checks passed
@MarshallOfSound
MarshallOfSound deleted the claude/siso-weights-file branch November 18, 2026 07:40
claude Bot pushed a commit that referenced this pull request Nov 18, 2026
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
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.

3 participants