Account nested declaration emits as emit time - #4557
Merged
Jake Bailey (jakebailey) merged 1 commit intoAug 10, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns incremental build-info state and performance accounting more closely with Strada.
Changes:
- Serializes clean-build file info compactly and records declaration signatures separately.
- Tracks pre-update signatures across incremental processing.
- Reclassifies forced declaration work as emit time and adds an incremental regression scenario.
Reviewed changes
Copilot reviewed 67 out of 232 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences3.js |
Updates build-info baseline. |
testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences2.js |
Updates build-info baseline. |
testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js |
Updates redirected-output baseline. |
testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js |
Updates missing-input baseline. |
testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js |
Updates non-relative import baseline. |
testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js |
Updates project-reference error baseline. |
testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-exist.js |
Updates missing-project baseline. |
testdata/baselines/reference/tsc/projectReferences/errors-when-the-file-list-is-not-exhaustive.js |
Updates file-list error baseline. |
testdata/baselines/reference/tsc/projectReferences/errors-when-declaration-=-false.js |
Updates declaration-option baseline. |
testdata/baselines/reference/tsc/projectReferences/errors-when-a-file-is-outside-the-rootdir.js |
Updates root-directory error baseline. |
testdata/baselines/reference/tsc/projectReferences/doesnt-infer-the-rootDir-from-source-paths.js |
Updates root inference baseline. |
testdata/baselines/reference/tsc/projectReferences/default-setup-was-created-correctly.js |
Updates default project baseline. |
testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-declaration-with-incremental.js |
Compacts no-emit syntax-error state. |
testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js |
Compacts no-emit semantic-error state. |
testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js |
Compacts declaration-error state. |
testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js |
Updates library-resolution build info. |
testdata/baselines/reference/tsc/incremental/serializing-composite-project.js |
Verifies composite serialization. |
testdata/baselines/reference/tsc/extends/resolves-the-symlink-path.js |
Updates symlink build-info baseline. |
testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-no-crash-no-jsx-element.js |
Updates JSX composite baseline. |
testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js |
Updates JSX error baseline. |
testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js |
Updates watched project state. |
testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js |
Updates watched emit-signature state. |
testdata/baselines/reference/tsbuildWatch/dependencyUpdate/watches-absolute-non-root-dependency-updates.js |
Updates watched dependency baseline. |
testdata/baselines/reference/tsbuild/solution/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js |
Updates solution build info. |
testdata/baselines/reference/tsbuild/sample/when-declaration-option-changes.js |
Updates declaration-change state. |
testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js |
Updates JSON-module build info. |
testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js |
Updates JSON sourcemap build info. |
testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js |
Updates JSON include baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js |
Updates no-outDir JSON baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js |
Updates external JSON baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-not-in-rootDir.js |
Updates out-of-root JSON baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js |
Updates mixed-include baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js |
Updates matching-name JSON baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js |
Updates include/files baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js |
Updates referenced JSON baseline. |
testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js |
Updates explicit JSON-files baseline. |
testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js |
Updates shared build-info baseline. |
testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental.js |
Updates non-incremental variant. |
testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental-with-tsc.js |
Updates tsc variant. |
testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js |
Updates inherited-rootDir variant. |
testdata/baselines/reference/tsbuild/programUpdates/when-root-is-source-from-project-reference.js |
Updates referenced-root state. |
testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js |
Updates composite output-path state. |
testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js |
Updates inferred output-path state. |
testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-declaration-with-incremental.js |
Updates build-mode syntax-error state. |
testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js |
Updates build-mode semantic-error state. |
testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js |
Updates build-mode declaration-error state. |
testdata/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js |
Updates unshared-resolution signatures. |
testdata/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js |
Updates shared-resolution signatures. |
testdata/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js |
Updates output declaration resolution. |
testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js |
Updates build-mode symlink baseline. |
testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-missing-dependency-package-json-is-added.js |
Updates missing-package rebuild state. |
testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-dependency-package-json-redirects-to-a-different-declaration-file.js |
Updates redirected-package state. |
testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-dependency-in-node_modules-is-updated.js |
Updates dependency rebuild state. |
testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-absolute-non-root-dependency-is-updated.js |
Updates absolute-dependency state. |
internal/execute/tsctests/tsc_test.go |
Adds the incremental comment-change scenario. |
internal/execute/tsc/emit.go |
Reclassifies nested declaration emit time. |
internal/execute/incremental/snapshottobuildinfo.go |
Serializes pre-update signatures. |
internal/execute/incremental/snapshot.go |
Stores old signatures in snapshots. |
internal/execute/incremental/programtosnapshot.go |
Carries uncommitted signatures forward. |
internal/execute/incremental/program.go |
Tracks nested emit duration. |
internal/execute/incremental/emitfileshandler.go |
Manages old signatures around emission. |
internal/execute/incremental/affectedfileshandler.go |
Tracks shape-update signatures and nested emits. |
Jake Bailey (jakebailey)
force-pushed
the
jabaile/tsgo-standalone-repro-slowdown
branch
2 times, most recently
from
July 23, 2026 15:08
3abbc39 to
44d67f7
Compare
Jake Bailey (jakebailey)
marked this pull request as ready for review
July 23, 2026 17:36
Jake Bailey (jakebailey)
marked this pull request as draft
July 23, 2026 21:41
Jake Bailey (jakebailey)
force-pushed
the
jabaile/tsgo-standalone-repro-slowdown
branch
from
July 29, 2026 23:16
44d67f7 to
8fbcc50
Compare
Jake Bailey (jakebailey)
force-pushed
the
jabaile/tsgo-standalone-repro-slowdown
branch
from
July 30, 2026 17:46
8fbcc50 to
56f071e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 76 out of 242 changed files in this pull request and generated no new comments.
Suppressed comments (1)
internal/execute/incremental/emitfileshandler.go:224
- This preserves the pre-emit signature even after the affected-file batch has emitted successfully, so
snapshotToBuildInfowrites the source version as the file's shape and moves the committed.d.tshash intoemitSignatures. On the next process, an implementation-only edit is therefore compared against the source hash and is treated as a shape change. The newpreserves-uncommitted-signatures-when-emitting-after-noEmitbaseline demonstrates the regression: changing onlyb.ts's comment refreshes/re-emitsc.ts. Strada only savesoldSignatureswhile an affected-file iteration is still rollbackable; otherwise the emitted signature is committed directly. Please retain the old value only for a genuinely in-progress/cancellable update, or clear it before writing build info after this emit batch succeeds.
h.program.snapshot.oldSignatures.LoadOrStore(data.SourceFile.Path(), info.signature)
Jake Bailey (jakebailey)
force-pushed
the
jabaile/tsgo-standalone-repro-slowdown
branch
from
August 10, 2026 19:44
1a99023 to
67b4caa
Compare
Measure forced declaration-signature work with the compilation System clock and move that duration from Check time to Emit time. Add a controlled-clock regression test around the full incremental compile path.
Jake Bailey (jakebailey)
force-pushed
the
jabaile/tsgo-standalone-repro-slowdown
branch
from
August 10, 2026 20:30
67b4caa to
9848d14
Compare
Member
Author
|
This has been redone to just bring it to accounting correctly, the other stuff was junk |
Gabriela Araujo Britto (gabritto)
approved these changes
Aug 10, 2026
Jake Bailey (jakebailey)
deleted the
jabaile/tsgo-standalone-repro-slowdown
branch
August 10, 2026 22:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Incremental shape checking computes declaration signatures using nested declaration emits. Those emits were previously included in Check time and omitted from Emit time.
This tracks nested emit duration with the compilation System clock, moves that duration from Check time to Emit time, and adds a controlled-clock regression test around the full incremental compilation path.