Skip to content

perf(validation): skip warm native rebuilds#577

Closed
JustYannicc wants to merge 73 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-native-build-incremental
Closed

perf(validation): skip warm native rebuilds#577
JustYannicc wants to merge 73 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-native-build-incremental

Conversation

@JustYannicc

@JustYannicc JustYannicc commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Added stamp-based up-to-date checks for top-level Swift helpers in scripts/build-native.mjs.
  • Added native_helpers.node invalidation keyed by addon sources, binding.gyp, package manifests/lockfile, Electron package, target arch, and build command.
  • Added Whisper transcriber invalidation keyed by source, build script/command, framework version/hash/url, and framework bundle mtimes.
  • Included Package.resolved and helper build scripts in Parakeet/Soulver rebuild checks.

Why

  • Warm native validation was still rebuilding the native addon and Whisper transcriber even when all inputs were unchanged.
  • The new checks keep changed sources, package manifests, lock/resolved files, framework inputs, Electron target, arch, and build script changes from being skipped.

Compatibility impact

  • No runtime behavior changes intended.
  • First run after this patch rebuilds and writes local dist/native stamp files; subsequent unchanged warm runs skip.
  • Missing outputs, missing inputs, changed mtimes/sizes, changed commands, changed Electron package/arch, or changed framework metadata force rebuilds.

How tested

  • node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js ci --ignore-scripts
  • env PATH=/tmp/supercmd-real-npm-bin:... /usr/bin/time -p node scripts/build-native.mjs
  • Stale Swift source regression from the original validation: touch src/native/color-picker.swift, rerun build-native; color-picker rebuilt while other helpers skipped.
  • Stale addon regression from the original validation: touch src/native/native-helpers-addon/native_helpers.mm, rerun build-native; node-gyp rebuilt native_helpers.node.
  • node --check scripts/build-native.mjs
  • node --check scripts/build-whispercpp.mjs
  • node --check scripts/build-parakeet.mjs
  • node --check scripts/build-soulver-calculator.mjs
  • ./node_modules/.bin/tsc -p tsconfig.main.json
  • git diff --check 15ee435...HEAD
  • Codex LSP diagnostics on scripts/ with severity error

Performance evidence

  • Original baseline immediate warm run before patch: real 13.83s, user 13.08s, sys 2.45s; native addon and Whisper transcriber rebuilt, Parakeet/Soulver skipped.
  • Original final after warm run: real 0.29s, user 0.23s, sys 0.04s; all targets reported up to date.
  • Original addon stale-input rebuild check: real 1.70s and node-gyp rebuilt native_helpers.node.
  • Repaired-branch population run: real 64.93s in a fresh worktree with missing native outputs/framework/package builds.
  • Repaired-branch immediate warm run: real 0.25s, user 0.21s, sys 0.03s; all targets reported up to date.

Stack validation

  • Built on repaired validation base 15ee435 fix(validation): make macos liquid glass dependency optional.
  • Branch: codex/perf-native-build-incremental.
  • Commit: 9c751bb perf(validation): skip warm native rebuilds.
  • PR perf(validation): skip warm native rebuilds #577 repaired in place; no duplicate PR opened.
  • Branch diff against 15ee435 contains only scripts/build-native.mjs, scripts/build-whispercpp.mjs, scripts/build-parakeet.mjs, and scripts/build-soulver-calculator.mjs.
  • Codex LSP diagnostics: scripts directory scanned for .mjs errors, 50 files capped, 0 files with errors, 0 diagnostics.
  • No pnpm-lock.yaml created and generated src/native/soulver-calculator/Package.resolved churn was restored before push.

Replaces

  • Native-build warm-overhead candidate from the delegated validation audit.

…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
… into codex/perf-consolidated-integration-stack
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by the consolidated validation PR: #578

@JustYannicc JustYannicc closed this Jul 4, 2026
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