Skip to content

fix(validation): enforce root search perf budgets - #608

Closed
JustYannicc wants to merge 121 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/wave5-root-search-perf-budgets
Closed

fix(validation): enforce root search perf budgets#608
JustYannicc wants to merge 121 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/wave5-root-search-perf-budgets

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Added root-search perf budget parsing for optimized median, indexed median, compile median, and optimized-vs-indexed speedup.
  • Kept the existing harness report output and added a clear stderr failure block plus nonzero exit when a configured budget fails.
  • Added subprocess tests covering both passing budgets and intentional failing-budget behavior.

Why

  • npm run test:perf:ci configured root-search budget env vars, but scripts/test-root-search-perf.mjs did not read or enforce them, so threshold regressions could pass silently.

Compatibility impact

  • No runtime application behavior change.
  • Validation now fails when configured root-search perf budgets are exceeded or malformed.

How tested

  • env SUPERCMD_ROOT_SEARCH_PERF_COMMANDS=50 SUPERCMD_ROOT_SEARCH_PERF_ITERATIONS=1 SUPERCMD_ROOT_SEARCH_PERF_OPTIMIZED_MEDIAN_MS=100000 SUPERCMD_ROOT_SEARCH_PERF_INDEXED_MEDIAN_MS=100000 SUPERCMD_ROOT_SEARCH_PERF_COMPILE_MEDIAN_MS=100000 SUPERCMD_ROOT_SEARCH_PERF_INDEXED_SPEEDUP_MIN=0 node scripts/test-root-search-perf.mjs passed, real 0.31s.
  • env SUPERCMD_ROOT_SEARCH_PERF_COMMANDS=50 SUPERCMD_ROOT_SEARCH_PERF_ITERATIONS=1 SUPERCMD_ROOT_SEARCH_PERF_OPTIMIZED_MEDIAN_MS=0.001 SUPERCMD_ROOT_SEARCH_PERF_INDEXED_MEDIAN_MS=0.001 SUPERCMD_ROOT_SEARCH_PERF_COMPILE_MEDIAN_MS=0.001 SUPERCMD_ROOT_SEARCH_PERF_INDEXED_SPEEDUP_MIN=999999 node scripts/test-root-search-perf.mjs failed intentionally with exit 1, real 0.31s.
  • node --test scripts/test-root-search-perf-budgets.mjs passed, real 0.74s.
  • npm run test:perf:ci passed, real 24.73s.
  • npm run test:ci passed, real 5.34s.
  • npm run typecheck:renderer passed, real 6.21s.
  • npm run build:main passed, real 3.88s.
  • npm run check:i18n passed, real 0.59s.

Performance evidence

  • Before: impossible-budget root-search run exited 0 despite medians over the configured limits, proving budgets were ignored; real 0.31s.
  • Before npm run test:perf:ci: passed in real 24.50s; root-search optimized median 614.34ms, indexed median 92.86ms, compile median 67.82ms, optimized-vs-indexed speedup 6.62x.
  • After npm run test:perf:ci: passed in real 24.73s; root-search optimized median 749.76ms <= 900ms, indexed median 106.30ms <= 350ms, compile median 82.16ms <= 500ms, optimized-vs-indexed speedup 7.05x >= 1.05x.

Stack validation

  • Started from codex/perf-wave4-integrated-stack-20260705 commit ac90ce403aeddab98d0a1b245afce268c48b8bfd with a clean worktree, then branched to codex/wave5-root-search-perf-budgets.
  • JS-only harness/test changes; no TypeScript or type definitions were touched.
  • Renderer typecheck result: npm run typecheck:renderer passed.

Replaces

  • Wave5 standalone; does not replace a prior PR.

(cherry picked from commit 83c2a89)
(cherry picked from commit 0a7560b)
# Conflicts:
#	src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…launcher surfaces

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…IO stalls

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
…resh overhead

# Conflicts:
#	scripts/bench-script-command-discovery.mjs
#	scripts/benchmark-file-search-delete-batch.mjs
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-file-search-delete-batch.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/file-search-index.ts
#	src/main/main.ts
…hurn

# Conflicts:
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-extension-lifecycle-sandbox.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/main.ts
#	src/renderer/src/ExtensionView.tsx
… hot paths

# Conflicts:
#	scripts/test-use-frecency-sorting.mjs
#	src/renderer/src/raycast-api/form-runtime.tsx
#	src/renderer/src/raycast-api/grid-runtime-hooks.ts
#	src/renderer/src/raycast-api/grid-runtime-items.tsx
#	src/renderer/src/raycast-api/hooks/use-frecency-sorting.ts
# Conflicts:
#	.github/workflows/project-checks.yml
#	package.json
#	scripts/file-search-perf-harness.mjs
#	scripts/test-browser-search-performance.mjs
#	scripts/test-file-search-perf-harness.mjs
#	scripts/test-root-search-perf.mjs
#	src/renderer/src/CameraExtension.tsx
#	src/renderer/src/hooks/useBrowserSearch.ts
#	src/renderer/src/raycast-api/list-runtime.tsx
…cle and media fixes

# Conflicts:
#	scripts/lib/ts-import.mjs
#	scripts/measure-extension-bundle-cache.mjs
#	src/main/commands.ts
#	src/main/extension-runner.ts
#	src/main/main.ts
#	src/renderer/src/ExtensionView.tsx
#	src/renderer/src/raycast-api/grid-runtime-hooks.ts
#	src/renderer/src/raycast-api/list-runtime-hooks.ts
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated PR #620: #620

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