Skip to content

Make completed MultiCompiler cohorts authoritative without FIFO hook identity #75

Description

@ScriptedAlchemy

Follow-up to the Rsbuild conformance audit: #72.

Problem

The runtime compile observer assigns an attempt ID in global onBeforeDevCompile and consumes IDs FIFO in onAfterDevCompile. Rsbuild documents lifecycle order but not a stable cycle ID, exact callback cardinality under coalesced invalidations, or one-to-one pairing when MultiCompiler children invalidate at different times. Rsbuild 2.2.1's shared-promise invalidation deduplication and synthesized global completion are implementation details.

A minor scheduling change can associate MultiStats with an older attempt, leave a newer activation barrier unsettled, or wedge generation supersession. The bounded conformance fix detects any non-singleton pending queue, fails all live attempts, and throws rather than silently misassociating them.

Proposed direction

  • Treat each successful completed MultiStats cohort as the authoritative monotonic identity.
  • Keep pre-compile observation advisory; it must not own an activation-blocking barrier.
  • Base supersession on completed cohort ordinals and prepared-runtime authority.
  • Add deterministic tests for coalesced, missing, duplicated, and reordered global callbacks plus skewed child invalidations.

Acceptance

  • No generation identity depends on FIFO position between global hooks.
  • Missing/duplicate/reordered callbacks cannot wedge activation or associate Stats with stale state.
  • Existing failed/no-op attempt and commit-window protections remain intact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions