GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(execute): single exit paths for pipe/wait and cache update by wan9chi · Pull Request #442 · voidzero-dev/vite-task

Conversation

@wan9chi

@wan9chi wan9chi commented Jun 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Motivation

execute_spawn reports errors through leaf_reporter.finish() — but from three different places, each duplicating the finish-and-return dance: a pipe failure reported inside the drain section, a wait failure had its own identical arm, and an archive-creation failure called finish() from deep inside the cache-update expression. Every change to this function has to keep those exits consistent by hand, and the runner-aware IPC work (#441) is about to thread per-task server state through exactly these paths — each early exit is one more place to forget a drain or a signal.

Approach

Two exit-point consolidations, no behavior change:

  • One error sink for pipe + wait. pipe_stdio and child.wait fold into a single child_work future; a pipe failure cancels (so the wait kills the child instead of orphaning it — same ordering as before) and surfaces through the same wait_result match as a wait failure. Box::pin(child_work) keeps the pipe stack off the enclosing future, which shrinks execute_spawn enough that the large_futures expects at both call sites become removable — clippy's unfulfilled-expectation lint enforces that this is true, not just claimed.
  • One exit for the cache-update section. The section becomes a 'cache_update: labeled block where every outcome — including the archive-creation failure that previously returned early — breaks with a (status, error) pair, reported by the single finish() at the end.

Also renames the post-execution fspy summary local from tracking to fspy_outcome, freeing the name for #441's per-task tracking state.

Same statuses, same errors, same messages: the entire snapshot suite is byte-identical. One nuance worth a reviewer's glance: a pipe failure's finish() now happens after the unified match rather than inline in the drain section — observably identical, deliberately so.

Second commit: split scheduling and cache-update out of execute_spawn

execute/mod.rs mixed three concerns — the DAG scheduler (which leaf runs when), the spawn pipeline (how one leaf runs), and the post-run cache decision — with reporting sprinkled through all of them (finish() called from seven places).

  • scheduler.rs: ExecutionContext + the dependency-ordered, fast-fail graph walking, plus Session::execute_graph. Pure move.
  • cache_update.rs: the may-this-run-be-cached decision flattened into guard clauses that name each refusal (cancelled, non-zero exit, read-write overlap, fspy unsupported), then fingerprint → archive → store. The labeled-block breaks become plain returns.
  • mod.rs keeps the typed ExecutionMode/CacheState and a pipeline whose phases (lookup_cache, replay_cache_hit, ExecutionMode::build, run_child, update_cache) construct a Report instead of reporting in place — the reporter-consuming finish() now happens in exactly one spot, in execute_spawn.

Still zero behavior change: snapshot suite byte-identical. #441 on top now integrates IPC as a Tracking field, one pipeline arm, and one guard clause, with its execute/mod.rs diff almost purely additive.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@wan9chi @claude
refactor(execute): single exit paths for pipe/wait and cache update
be834f7
execute_spawn had three early error exits that each duplicated the
finish-and-return dance: a pipe failure reported and returned inside the
drain section, a wait failure had its own identical arm, and an
archive-creation failure called finish() from deep inside the
cache-update expression.

Fold pipe-drain and child-wait into one child_work future whose pipe
failure cancels, reaps the child, and surfaces through the same
wait_result match as a wait failure. Convert the cache-update section to
a labeled block where every outcome breaks with a (status, error) pair,
reported by the single finish() at the end.

Box::pin(child_work) keeps the pipe stack off the enclosing future,
which shrinks execute_spawn enough that the large_futures expects at
both call sites become removable (clippy enforces this). Also rename
the post-execution fspy summary local from tracking to fspy_outcome —
clearer, and it frees the name for the upcoming per-task IPC tracking
state (#441).

No behavior change: same statuses, same errors, same messages; the
entire snapshot suite is byte-identical.

Co-Authored-By: Claude Fable 5 <[email protected]>
@wan9chi
wan9chi marked this pull request as ready for review June 11, 2026 17:43
@wan9chi Graphite App

wan9chi commented Jun 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author
  • feat(cache): honor runner ignored inputs #431 Graphite
  • test(e2e): verify real Vite env cache tracking #451 Graphite
  • feat(cache): fingerprint getEnvs match sets #450 Graphite
  • feat(client): serve getEnvs over runner IPC #449 Graphite
  • feat(cache): fingerprint tracked getEnv reads #448 Graphite
  • fix(plan): serve runner getEnv from unfiltered env context #447 Graphite
  • feat(client): serve getEnv over runner IPC #446 Graphite
  • fix(cache): provide runner IPC for explicit-input tasks #430 Graphite
  • feat(ipc): runner ↔ tool IPC channel with disableCache #441 Graphite
  • refactor(execute): single exit paths for pipe/wait and cache update #442 Graphite 👈 (View in Graphite)
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jun 11, 2026
fix(cache): provide runner IPC for explicit-input tasks #430
Merged
feat(cache): honor runner ignored inputs #431
Merged
feat(ipc): runner ↔ tool IPC channel with disableCache #441
Merged
@wan9chi
wan9chi force-pushed the execute-spawn-exit-paths branch 2 times, most recently from b886a13 to c9a46fd Compare June 12, 2026 01:12
@wan9chi @claude
refactor(execute): split scheduling and cache-update out of execute_s…
a100974
…pawn

execute/mod.rs mixed three concerns: the DAG scheduler (which leaf runs
when), the spawn pipeline (how one leaf runs), and the post-run cache
decision — plus reporting sprinkled through all of them, with finish()
called from seven different places.

- scheduler.rs: ExecutionContext and the dependency-ordered, fast-fail
  graph walking, plus Session::execute_graph. Pure move.
- cache_update.rs: the may-this-run-be-cached decision flattened into
  guard clauses that name each refusal (cancelled, non-zero exit,
  read-write overlap, fspy unsupported), then fingerprint + archive +
  store. The labeled-block breaks become plain returns.
- mod.rs keeps the typed ExecutionMode/CacheState and a pipeline whose
  phases construct a Report instead of reporting in place; the
  reporter-consuming finish() happens in exactly one spot.

The pipeline types make invalid states unrepresentable: Report is an
enum whose variants (Failed / CacheHit / Spawned) each carry exactly the
data that outcome can be accompanied by — a cache hit with an exit
status or a spawned process without one cannot be constructed, and the
SpawnOutcome returned to the caller is derived from the same variant.
Likewise CacheLookup replaces a (status, Option<entry>, globs) triple
whose fields could disagree. The pipeline short-circuits with ? over
Result<_, Report>: both sides carry the same Report deliberately — Err
is the early-exit channel, Ok fell off the end, and the caller unwraps
both into the same single finish(), so the distinction is pure control
flow (documented on run()).

No behavior change: same statuses, errors, and messages; the snapshot
suite is byte-identical. Sets up #441's IPC integration to slot in as a
Tracking field, one pipeline arm, and one guard clause.

Co-Authored-By: Claude Fable 5 <[email protected]>
@wan9chi
wan9chi force-pushed the execute-spawn-exit-paths branch from c9a46fd to a100974 Compare June 12, 2026 01:35
@wan9chi
wan9chi merged commit 152fbfe into main Jun 12, 2026
18 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi
wan9chi deleted the execute-spawn-exit-paths branch June 12, 2026 01:40
This was referenced Jun 13, 2026
feat(client): serve getEnv over runner IPC #446
Merged
fix(plan): serve runner getEnv from unfiltered env context #447
Merged
feat(cache): fingerprint tracked getEnv reads #448
Merged
feat(client): serve getEnvs over runner IPC #449
Merged
feat(cache): fingerprint getEnvs match sets #450
Merged
test(e2e): verify real Vite env cache tracking #451
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@wan9chi
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.