Skip to content

Fix rewatch warning replay after early compile errors#8408

Draft
cknitt wants to merge 3 commits into
masterfrom
codex/fix-rewatch-warning-replay
Draft

Fix rewatch warning replay after early compile errors#8408
cknitt wants to merge 3 commits into
masterfrom
codex/fix-rewatch-warning-replay

Conversation

@cknitt
Copy link
Copy Markdown
Member

@cknitt cknitt commented May 4, 2026

Summary

Fixes warning replay after an early rewatch compile error.

When the DAG scheduler hits a compile error, it stops dispatching new modules. Some modules can still be in the compile universe but never actually compile. Before this change, warning replay used membership in the compile universe as the skip condition, so stored warnings on those unscheduled modules were skipped.

This change tracks the modules that actually compiled and replays warnings for the ones that did not. It also emits fresh and replayed warnings through one sorted path, so diagnostic output stays deterministic.

Changes

  • Track modules that actually compiled, while keeping stored warnings available for modules that were skipped or short-circuited.
  • Emit fresh and replayed warnings through one deterministic module-name-sorted path.
  • Add regression tests for skipped-module warning replay and mixed fresh/replayed warning ordering.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8408

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8408

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8408

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8408

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8408

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8408

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8408

commit: d3a7f04

@cknitt cknitt requested review from fhammerschmidt and removed request for fhammerschmidt May 4, 2026 11:09
@cknitt cknitt marked this pull request as draft May 4, 2026 13:36
cknitt added 2 commits May 19, 2026 16:41
Signed-off-by: Christoph Knittel <ck@cca.io>

# Conflicts:
#	rewatch/src/build/compile.rs
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt cknitt force-pushed the codex/fix-rewatch-warning-replay branch from a3eb179 to cf3418e Compare May 19, 2026 14:41
@cknitt
Copy link
Copy Markdown
Member Author

cknitt commented May 19, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf3418edb4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Collect warnings from modules that were not recompiled in this build but still have stored
// warnings from a previous compilation. This includes ready modules that were in the compile
// universe but never scheduled because an earlier module failed.
for (module_name, module) in build_state.modules.iter() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Sort replayed warning modules deterministically

When an early compile error leaves more than one warning-bearing module unscheduled, this new replay path emits those stored warnings in AHashMap iteration order. The compiled results above are explicitly sorted to keep diagnostics and snapshots deterministic, but this loop bypasses that ordering, so two skipped modules with stored warnings can still appear in a different order across processes/hash seeds. Please collect and sort the module names before appending their stored warnings.

Useful? React with 👍 / 👎.

Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt cknitt force-pushed the codex/fix-rewatch-warning-replay branch from 15c9084 to d3a7f04 Compare May 19, 2026 15:04
@cknitt
Copy link
Copy Markdown
Member Author

cknitt commented May 19, 2026

@codex review

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.10%. Comparing base (892d3aa) to head (d3a7f04).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8408      +/-   ##
==========================================
+ Coverage   58.78%   59.10%   +0.32%     
==========================================
  Files         373      373              
  Lines       54210    54210              
==========================================
+ Hits        31865    32040     +175     
+ Misses      22345    22170     -175     

see 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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