Skip to content

Stage immutable per-environment outputs before assembling runtime cohorts #74

Description

@ScriptedAlchemy

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

Problem

The runtime observer correlates MultiStats.children[] by environment name, then captures mutable writeToDisk roots after global completion. Rspack documents optional Stats name / hash fields, but Rsbuild does not promise child names equal environment keys. Rsbuild also documents parallel environments, not a transactional filesystem snapshot across compiler output roots.

A naming change fails loudly, but scheduling drift can let Stats hashes and copied RSC/widget/App files describe different child moments. The bounded conformance fix explicitly sets Rspack compiler names, retains exact-child assertions, serializes capture, and documents the empirical cross-root timing assumption.

Proposed direction

  • Stage an immutable output checkpoint for each environment in onAfterEnvironmentCompile.
  • Associate each checkpoint with that environment's successful Stats hash.
  • Assemble a runtime cohort only from a complete compatible checkpoint set.
  • Garbage-collect superseded/incomplete checkpoints without mutating an admitted generation candidate.

Acceptance

  • Generation capture never reads mutable live compiler roots as a cross-environment cohort.
  • Stats hashes and copied bytes come from the same immutable per-environment checkpoints.
  • Tests cover reordered/skewed child completion, invalidation during assembly, and checkpoint cleanup.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions