stablyai/orca · warning · Error

no benchmark file exists at both HEAD and HEAD~1 in this che

Error message

no benchmark file exists at both HEAD and HEAD~1 in this checkout

What it means

Thrown by the git-diff-blob-concurrency benchmark when none of its hard-coded CANDIDATE file paths exist as blobs at both HEAD and HEAD~1. The benchmark measures per-diff latency by reading two git blobs (parent and child sides), so it needs at least one file present on both commits to have anything to time. Each candidate is probed with `git cat-file -e <ref>:<path>` on both sides; a missing side is silently skipped.

Source

Thrown at config/scripts/git-diff-blob-concurrency-benchmark.mjs:104

// cost and the size-dependent read cost are both represented.
const CANDIDATES = [
  'src/main/git/status.ts',
  'src/shared/agent-hook-listener.ts',
  'src/renderer/src/components/TaskPage.tsx'
]

const files = []
for (const filePath of CANDIDATES) {
  try {
    await git(['cat-file', '-e', `${parent}:${filePath}`])
    await git(['cat-file', '-e', `${head}:${filePath}`])
    files.push(filePath)
  } catch {
    // Skip a path that does not exist on both sides in this checkout.
  }
}
if (files.length === 0) {
  throw new Error('no benchmark file exists at both HEAD and HEAD~1 in this checkout')
}

const pad = (value, width) => String(value).padStart(width)
console.log('One file diff = two git blob reads. Lower is better.')
console.log(
  `iterations=${ITERATIONS} warmup=${WARMUP} (interleaved, medians) head=${head.slice(0, 9)}`
)
console.log(
  `${pad('file', 26)} ${pad('sequential', 12)} ${pad('concurrent', 12)} ${pad('speedup', 9)} ${pad('saved', 10)}`
)
for (const filePath of files) {
  const sequentialBytes = await readSequential(parent, head, filePath)
  const concurrentBytes = await readConcurrent(parent, head, filePath)
  if (sequentialBytes !== concurrentBytes) {
    throw new Error(`byte mismatch for ${filePath}`)
  }
  const { sequential, concurrent } = await measureInterleaved(parent, head, filePath)
  console.log(

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Ensure the checkout is non-shallow: run `git fetch --unshallow` (or `git fetch --deepen=2`) so HEAD~1 resolves.
  2. Verify history exists: run `git rev-parse HEAD~1` — if it errors, the checkout lacks the parent commit.
  3. Confirm at least one candidate exists on both sides: `git cat-file -e HEAD~1:src/main/git/status.ts && git cat-file -e HEAD:src/main/git/status.ts`.
  4. Checkout a commit where the candidate files are stable across the parent boundary, or add a touched candidate file so the benchmark has a measurable pair.

Example fix

// before: running in a shallow clone
git clone --depth 1 <repo> && node config/scripts/git-diff-blob-concurrency-benchmark.mjs
// after: deepen so HEAD~1 exists
git fetch --unshallow && node config/scripts/git-diff-blob-concurrency-benchmark.mjs
Defensive patterns

Strategy: validation

Validate before calling

// Verify HEAD~1 resolves and at least one candidate exists on both sides before running
import { execFileSync } from 'node:child_process'
const CANDIDATES = ['src/main/git/status.ts', 'src/shared/agent-hook-listener.ts', 'src/renderer/src/components/TaskPage.tsx']
try { execFileSync('git', ['rev-parse', '--verify', 'HEAD~1'], { stdio: 'ignore' }) }
catch { throw new Error('checkout is shallow or has no HEAD~1; run git fetch --unshallow') }
const head = execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim()
const ok = CANDIDATES.some((p) => {
  try { execFileSync('git', ['cat-file', '-e', `HEAD~1:${p}`], { stdio: 'ignore' }); execFileSync('git', ['cat-file', '-e', `HEAD:${p}`], { stdio: 'ignore' }); return true }
  catch { return false }
})
if (!ok) throw new Error('no candidate file on both HEAD and HEAD~1')

Prevention

When it happens

Trigger: Running the benchmark in a shallow clone (no HEAD~1), a fresh repo with under two commits, an empty tree, or on a branch where all three candidates (`src/main/git/status.ts`, `src/shared/agent-hook-listener.ts`, `src/renderer/src/components/TaskPage.tsx`) were added/renamed/deleted between HEAD and HEAD~1. Also fires on a detached HEAD pointing at the initial commit.

Common situations: CI runs against a shallow-cloned checkout (--depth 1), local testing on a brand-new worktree before history is fetched, running after a large refactor that moved or deleted the candidate source files, or running in a sparse/partial checkout.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/60c88dd2c4fe3a30. Report an issue: GitHub.