From eaf256ef4e7a812762fe144669ad281bba5fdb38 Mon Sep 17 00:00:00 2001 From: hatayama Date: Fri, 16 Oct 2026 21:12:35 +0900 Subject: [PATCH 1/3] test: pin that a run leaving an assembly out keeps its compile-check baseline An assembly whose own inputs did not change is not planned, and nothing in the run touches what the check recorded for it. Pin that its outputs, result, and baseline survive such a run, whether the run compiles nothing or only another assembly, and that its next body edit is checked rather than compiled in full. --- .../internal/compilecheck/fast_path_test.go | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cli/dispatcher/internal/compilecheck/fast_path_test.go b/cli/dispatcher/internal/compilecheck/fast_path_test.go index b4bdd277d..1f43e6a81 100644 --- a/cli/dispatcher/internal/compilecheck/fast_path_test.go +++ b/cli/dispatcher/internal/compilecheck/fast_path_test.go @@ -470,6 +470,29 @@ func TestRevertedContentIsReused(t *testing.T) { } } +// Verifies that a run leaving an assembly out of its plan, because nothing it compiles from changed, +// keeps that assembly's outputs, result, and baseline as they were, whether the run compiles nothing +// or only another assembly, so the next body edit of it is checked against that baseline. +func TestRunLeavingAnAssemblyOutKeepsItsBaseline(t *testing.T) { + for label, planned := range map[string][]string{"nothing": {}, "another assembly": {"Beta"}} { + t.Run(label, func(t *testing.T) { + project := newFastPathProject(t, fastPathMinimumSources) + project.recordBaseline(t) + before := project.outputSnapshot(t) + full := project.plan + project.plan = project.withOnlyUnits(planned...) + project.run(t, newCachedSchedulerRecorder(planned...), false) + project.plan = full + + if after := project.outputSnapshot(t); !reflect.DeepEqual(after, before) { + t.Fatalf("expected the outputs, result, and baseline to stay, got %v then %v", before, after) + } + project.editBody(t, 0, "edited") + project.runFastChecked(t) + }) + } +} + // Verifies that a baseline agreeing with every source but disagreeing with the current key is // dropped, and the unit compiles in full. func TestZeroChangedFilesDropsBaselineAndFallsBack(t *testing.T) { From 5e9857d2658a6ef201421550705a891a174c1232 Mon Sep 17 00:00:00 2001 From: hatayama Date: Fri, 16 Oct 2026 21:13:37 +0900 Subject: [PATCH 2/3] docs: say which compile-check runs drop an assembly's baseline The changed-files check docs said a run that skips an assembly because nothing it compiles from changed removes its result and baseline. Only a dependent the run picked up because a reference changed, and then left out because every such reference kept its surface or changed only names it never writes, loses them. An assembly the plan never selects keeps both, so its next body edit is checked. --- docs/compile-check.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/compile-check.md b/docs/compile-check.md index d97acce0f..0d93628a7 100644 --- a/docs/compile-check.md +++ b/docs/compile-check.md @@ -215,8 +215,9 @@ build - does not call the worker again: it reports what the previous check repor Otherwise the assembly is compiled in full as before, and `FastPathFallbacks` says why: - `no baseline: no full compile of this assembly is on record` (none ran yet, a later run - skipped the assembly, which removes its result and baseline, or an input changed while - the last full compile ran, so it left no record; `FastPathBaselineNotes` of that run says which) + picked the assembly up only because a reference changed and then skipped it, which removes its + result and baseline, or an input changed while the last full compile ran, so it left no record; + `FastPathBaselineNotes` of that run says which) - `no baseline: the last full compile had errors; the first full compile without errors records one` (a full compile that fails drops the baseline an earlier one left, and the assembly is compiled in full until a compile succeeds) @@ -256,11 +257,15 @@ So the first body edit is compiled in full more often than it looks: and the first body edit is checked as usual. Only when that run leaves the reference out, so it reads Unity's build instead, does the first body edit of an assembly referencing it fall back with `inputs other than source contents changed: references`. -- A run that skips an assembly because nothing it compiles from changed removes its result and - baseline, so its next body edit is compiled in full. A run that blocks it because an assembly it - references has errors keeps them: the next run checks them against the inputs and output hashes - they were recorded with before using them, so a reference that comes back the same leaves the - assembly reused or checked on its changed files, and one that comes back changed compiles it. +- An assembly a run leaves out because nothing it compiles from changed keeps its result and + baseline, so its next body edit is checked against them. What a run removes is the result and + baseline of an assembly it picked up only because a reference changed and then skipped, because + every such reference kept its public surface or changed only names the assembly never writes; the + next body edit of that assembly is compiled in full. A run that blocks an assembly because one it + references has errors keeps its result and baseline: the next run checks them against the inputs + and output hashes they were recorded with before using them, so a reference that comes back the + same leaves the assembly reused or checked on its changed files, and one that comes back changed + compiles it. - A full compile while the assembly still has errors, whether a `--full` run or a run that fell back to one, drops its baseline, so the run after the fix is compiled in full. Running `--full` once the errors are fixed keeps it. From 3f707e9286d1709bcf85f04e231449dfca18f9df Mon Sep 17 00:00:00 2001 From: hatayama Date: Fri, 16 Oct 2026 21:24:23 +0900 Subject: [PATCH 3/3] docs: a compiled dependent loses its compile-check baseline too A dependent the run picks up only because a reference changed records no baseline when it is compiled, and has its result and baseline removed when it is left out, so the docs no longer say the latter is the only case. The compile-check skill said a run that skipped the assembly makes its next body edit compile in full; narrow that to such a dependent. --- .../CliOnlyTools~/CompileCheck/Skill/SKILL.md | 8 ++++---- docs/compile-check.md | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Packages/src/Editor/CliOnlyTools~/CompileCheck/Skill/SKILL.md b/Packages/src/Editor/CliOnlyTools~/CompileCheck/Skill/SKILL.md index aac289225..6e73277ee 100644 --- a/Packages/src/Editor/CliOnlyTools~/CompileCheck/Skill/SKILL.md +++ b/Packages/src/Editor/CliOnlyTools~/CompileCheck/Skill/SKILL.md @@ -59,10 +59,10 @@ directive counts as a declaration change. Such a check skips a few assembly-wide with `--full` before finishing. When the project treats warnings as errors, a rule listed in `UncheckedCodes`, such as CS0414, can fail that `--full` run only. The first body edit after a Unity build, after a full compile that had errors (a `--full` run or a run that fell back to one), after -a run that compiled it only because an assembly it references changed, after a run that skipped the -assembly, or after `--all` in an assembly that references one whose rebuilt API differed from the -last Unity build and that the next run no longer rebuilds is compiled in full and records what the -next check compares against; `FastPathFallbacks` says why. +a run that picked it up only because an assembly it references changed, whether it compiled or +skipped the assembly, or after `--all` in an assembly that references one whose rebuilt API +differed from the last Unity build and that the next run no longer rebuilds is compiled in full and +records what the next check compares against; `FastPathFallbacks` says why. ## Parameters diff --git a/docs/compile-check.md b/docs/compile-check.md index 0d93628a7..6f6f0f3c1 100644 --- a/docs/compile-check.md +++ b/docs/compile-check.md @@ -258,14 +258,14 @@ So the first body edit is compiled in full more often than it looks: reads Unity's build instead, does the first body edit of an assembly referencing it fall back with `inputs other than source contents changed: references`. - An assembly a run leaves out because nothing it compiles from changed keeps its result and - baseline, so its next body edit is checked against them. What a run removes is the result and - baseline of an assembly it picked up only because a reference changed and then skipped, because - every such reference kept its public surface or changed only names the assembly never writes; the - next body edit of that assembly is compiled in full. A run that blocks an assembly because one it - references has errors keeps its result and baseline: the next run checks them against the inputs - and output hashes they were recorded with before using them, so a reference that comes back the - same leaves the assembly reused or checked on its changed files, and one that comes back changed - compiles it. + baseline, so its next body edit is checked against them. An assembly a run picks up only because + a reference changed loses its result and baseline either way: compiled, it records no baseline, + and left out, because every such reference kept its public surface or changed only names the + assembly never writes, its result and baseline are removed. The next body edit of that assembly + is compiled in full. A run that blocks an assembly because one it references has errors keeps + its result and baseline: the next run checks them against the inputs and output hashes they were + recorded with before using them, so a reference that comes back the same leaves the assembly + reused or checked on its changed files, and one that comes back changed compiles it. - A full compile while the assembly still has errors, whether a `--full` run or a run that fell back to one, drops its baseline, so the run after the fix is compiled in full. Running `--full` once the errors are fixed keeps it.