Repository navigation
fix(cli): isolate benchmark render files - #6403
Merged
miguel-heygen merged 1 commit intoOct 26, 2026
Merged
Conversation
miguel-heygen
approved these changes
Oct 26, 2026
miguel-heygen
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this. The fix is small and lands in the right place: the output directory comes from a single line, and it now uses the same mkdtempSync(join(tmpdir(), ...)) pattern as compare and grade-compare.
What I checked:
- On main,
benchmark.tsresolvesrenders/.benchmarkfrom the working directory, and output names only depend on the config label and run index, so concurrent runs overwrite each other and the files are never removed. Nothing else in the repo reads that directory, so moving it doesn't break anything. - The producer creates its work directory next to the output path and removes it itself, so its intermediate files also land in the per-run temp directory.
- Sizes are measured inside the loop, before the directory is removed, so the reported results don't change.
- I reverted each half of the fix and reran the tests. Going back to a fixed directory fails the new test ("not to be renders/.benchmark"), and dropping the
rmSyncfails it too. On the PR head the file passes 12/12, three runs in a row.
Two small, non-blocking suggestions:
- nit: the temp directory is created before
loadProducer()(benchmark.ts:75vs:79-94). If the producer fails to load,failCommand()throws before thermSyncat:163, which leaves an emptyhyperframes-benchmark-*directory behind. Creating the directory after the producer loads, or wrapping the loop intry/finallylikecompare.tsdoes, would cover that. - nit: every render is kept until all configs finish, so with
--runs 20there are 100 files in the temp directory at once, and on systems where/tmpis in memory that adds up. Deleting each file right after itsstatSyncwould keep only one at a time. Happy either way.
CI has finished green at this head.
Verdict: APPROVE
Reasoning: Correct root-cause fix with tests that fail without it, and all checks pass at this head.
SanHsien
added a commit
to SanHsien/hyperframes
that referenced
this pull request
Oct 26, 2026
Merge 20 more upstream commits (acd0bc3..ad4d3fa, v0.8.205: heygen-com#6403, heygen-com#6363, heygen-com#6209, heygen-com#6395, heygen-com#6424, heygen-com#6426, heygen-com#6442, heygen-com#6430, heygen-com#6402, heygen-com#6435, heygen-com#6439, heygen-com#6449, heygen-com#5436, heygen-com#6455 and docs). No conflicts. Record the 11 open PRs heygen-com#6440-heygen-com#6458 and issue heygen-com#6443 in docs/DECISIONS.md (none adopted), re-check the earlier open PRs, and advance the commit watermark to ad4d3fa, the PR watermark to heygen-com#6458 and the issue watermark to heygen-com#6443. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Give each
hyperframes benchmarkinvocation its own OS temporary render directory and remove those render files after their measurements are collected.Why
Benchmark render files are implementation details, but separate invocations currently share deterministic paths under
renders/.benchmark. Concurrent benchmarks or benchmarks launched for different projects from the same working directory can overwrite one another, and completed runs leave generated media behind.Root cause
The command resolves one fixed
renders/.benchmarkdirectory from the caller's working directory and derives each output filename only from the benchmark configuration and run index.Related work
No related issue or overlapping PR was found. This is a small self-contained correction, so no separate issue was created.
How
hyperframes-benchmark-*directory under the operating system temporary directory for each command invocation.Before and after
Before:
renders/.benchmark.After:
Test plan
Regression tests:
bun run --cwd packages/cli test src/commands/benchmark.test.ts: 1 file passed, 12 tests passed.bun run --cwd packages/cli typecheck: passed.bun run build: passed on current main.bun run lint: passed with 0 warnings and 0 errors.COMMENT_CHECK_BASE=upstream/main node scripts/check-comment-citations.mjs: passed, 2 files examined.COMMENT_CHECK_BASE=upstream/main node scripts/comment-ratchet.mjs: passed, 1 changed source file.A full CLI test run was also attempted locally: 5,923 tests passed, 105 skipped, and 8 unrelated environment-sensitive tests failed. An untouched upstream worktree reproduced seven stable failures involving macOS
/varpath canonicalization, an installed systemwhisper-cli, unavailable WebGL contexts, and Node deprecation output. One filesystem-watcher failure and one proxy teardownECONNRESETwere intermittent under the concurrent full run.Compatibility
This uses Node's cross-platform
tmpdir,mkdtempSync, andrmSyncAPIs. Result calculation, JSON shape, render configurations, and user-selected project paths are unchanged. A force-killed process can still leave its unique directory for normal OS temporary-file cleanup, but it cannot collide with another benchmark invocation.