Skip to content

check intersection props for never-reduction in a stable order - #64521

Draft
Max Schwenk (maschwenk) wants to merge 1 commit into
microsoft:mainfrom
maschwenk:fix/never-reduction-order
Draft

Max Schwenk (maschwenk) wants to merge 1 commit into
microsoft:mainfrom
maschwenk:fix/never-reduction-order

Conversation

@maschwenk

@maschwenk Max Schwenk (maschwenk) commented Sep 29, 2026 •

Copy link
Copy Markdown

follow up to:

somePropertyReducesToNever ranges over a map, so the order it builds the combined properties in is random. when an intersection has more than one candidate, which ones get built before it returns changes from run to run, so the same program does slightly different work each time

on vscode from typescript-benchmarking with --singleThreaded, the symbol count comes out 8557485 / 8557513 / 8557486 on main, and 8557373 every time with this. before that PR it was stable too

diagnostics were the same in everything i ran (the 6 typescript-benchmarking tsc projects give the same output with and without this), but different work run to run is how order dependent output sneaks in, and it makes perf comparisons noisy

this keeps the counts in a collections.OrderedMap so the names are checked in the order they were found

  • up to date with main
  • tests pass (go test ./... in tsc), except TestFSEventsWatchFileDifferentCasing, a macOS file watcher test that fails for me under load and passes on its own
  • hereby lint
  • hereby check:format

used claude code to help write this, ive reviewed it

somePropertyReducesToNever ranged over a map, so the combined properties it
creates were created in a random order, and when there was more than one
candidate, which of them got created before it returned varied between runs.
Keep the counts in an OrderedMap so the properties are checked in the order
they were found.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 29, 2026

This branch has not been deployed

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

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant