Skip to content

Parse a file again, alone, after it first crashes a worker - #142

Merged
quaesitor-scientiam merged 1 commit into
masterfrom
claude/retry-crashed-parse
Oct 29, 2026
Merged

quaesitor-scientiam merged 1 commit into
masterfrom
claude/retry-crashed-parse

Conversation

@quaesitor-scientiam

Copy link
Copy Markdown
Owner

Problem

The extract parses files in worker processes (graphify _parse-batch), in batches of 200, so that a crash in the parser costs one file, not the extract. When a worker died, the extract skipped the file it was on at once: the file was reported as unparseable, its last extract was carried forward if there was one, and the rest of the batch was requeued.

A crash that doesn't happen again therefore cost the file too. In master's CI run 40875434161 (after #141), the Windows worker crashed on vlib/v/types/checker_parallel.v:

skipped 1 unparseable file(s): vlib/v/types/checker_parallel.v

The Windows graph had 306 fewer symbols than the macOS and Linux graphs, and same-graph failed. The PR's two runs, with the same graphify and the same V commit (b5a2c25), parsed the file on Windows, and so did a re-run of the master run. The crash couldn't be reproduced on macOS, with CRLF line ends or with a 512 KB stack.

Change

  • ParseRun.parse keeps the files that have crashed a worker (ParseRun.crashed). The first time a file does, it is requeued in a batch of its own, ahead of the queue, and the rest of the batch is requeued as before.
  • A file that crashes its worker again is skipped as before: reported as unparseable, with its last extract carried forward.

A file crashes a worker at most twice, so the extract still ends. One that crashes every time now costs one more worker start.

Tests

  • New check_crash_once in test_a_worker_crash_is_recovered_from_on_both_paths (graphify_test.v): the stand-in worker crashes on crash.v once. The file is neither failed nor stale, and its symbols and those of the file queued behind it are in the graph. Without the change it fails: crash.v is in failed.
  • The two existing cases, where the worker crashes on the file every time, still pass: the file is failed, with or without an earlier extract to carry forward.
  • v test . and v run bin/test-crlf.vsh pass. An extract of the V tree with a -prod build skips no files.

🤖 Generated with Claude Code

A parse worker that crashed on a file made the extract skip it at once. On
master's CI, a Windows worker crashed once on vlib/v/types/checker_parallel.v,
which parsed on every other run, and same-graph failed for the 306 symbols
left out. Now the first crash requeues the file in a batch of its own; only a
second crash skips it, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quaesitor-scientiam
quaesitor-scientiam merged commit 61d8236 into master Oct 29, 2026
14 checks passed
@quaesitor-scientiam
quaesitor-scientiam deleted the claude/retry-crashed-parse branch October 29, 2026 13:42
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