Skip to content

fix(tsrs-wasm): catch edited inputs when -b runs over in-memory files - #1217

Merged
maschwenk merged 1 commit into
mainfrom
max/fix-1042-wasm-memory-mtimes
Dec 1, 2026
Merged

maschwenk merged 1 commit into
mainfrom
max/fix-1042-wasm-memory-mtimes

Conversation

@maschwenk

@maschwenk maschwenk commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

memoryFileSystem gave every file an mtime of 0 and ignored chtimes. on a second in-memory tsc -b with the first build's outputs passed back, an edited input was no newer than its build info, so -b reported the project up to date without checking the edit. memoryFileSystem now gives passed-in .tsbuildinfo files the oldest time, files starting with {"version":" (custom tsBuildInfoFile) the next oldest, and everything else a newer time. -b then checks inputs by content in any stat order, and a JSON input with that prefix is still newer than .tsbuildinfo. writes follow the module's real-time clock and are strictly increasing, and chtimes records the time given. Fixes #1042 and supersedes #1043, which dated files at first stat() so it depended on stat order

tsconfig has no content check, so every project with passed-in build info builds again. composite and incremental projects re-emit only what changed and nothing when nothing changed, while others re-emit everything. --verbose and --dry report those projects as out of date because of tsconfig.json. a custom-named build info that doesn't start with {"version":" (edited by hand, pretty-printed) still ties with the sources, as does a config or JSON input that starts with that prefix next to a custom-named build info, so those can still miss an edit tests build each case natively on disk and in memory and compare output, exit code and changed files. they cover the issue's edit with the default and a custom build info name, nothing edited, and an upstream edit with and without a .d.ts change. the first and last fail on main

memoryFileSystem gave every file a modification time of 0 and ignored
chtimes. On a second in-memory `tsc -b`, an edited input was then no
newer than the .tsbuildinfo passed back with it, and the project was
reported up to date without checking the edit.

Files passed in have no history, so the host now dates every build info
file passed in before every other file passed in. `--build` then checks
each input against the build info by content, whatever order it stats
files in. A build info file is a `.tsbuildinfo` file, or a file under a
custom `tsBuildInfoFile` name that starts the way build info does. The
`.tsbuildinfo` files are older still, so a JSON input that happens to
start like build info is still checked against them. Writes take their
times from the module's real-time clock, which the compiler compares
them with, and chtimes records the time it is given.

Fixes #1042
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main 8a8951516cc3 β†’ PR merge 641076d6bde8 (head f7e16b22ce9d)

Clef gate: Clef estimated 23.2% default and single-threaded wall time, 17.4% peak RSS, 17.2% single-threaded instruction count impact probability.

The main and PR tsrs release binaries are byte-for-byte identical. No compiler performance difference to measure.

tsrs-lint

The main and PR tsrs-lint binaries are byte-for-byte identical. No lint performance difference to measure.

@codspeed

codspeed Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

Warning

oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

βœ… 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing max/fix-1042-wasm-memory-mtimes (f7e16b2) with main (8a89515)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@maschwenk
maschwenk marked this pull request as ready for review December 1, 2026 16:30
@maschwenk
maschwenk added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 03f3ba7 Dec 1, 2026
49 of 51 checks passed
@maschwenk
maschwenk deleted the max/fix-1042-wasm-memory-mtimes branch December 1, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

@tsrs/wasm skips edited source files on a second in-memory tsc -b build

1 participant