From f9eceae0aa84f52a9fef370f4a199879c8637c1e Mon Sep 17 00:00:00 2001 From: hatayama Date: Thu, 8 Oct 2026 08:39:54 +0900 Subject: [PATCH 1/3] Expect the Debug-switch warning to name the startup preference Unity restores the Code Optimization On Startup preference on restart, a per-user setting that may itself be Debug, so saying the setting reverts misleads readers into expecting Release. --- .../internal/projectrunner/pause_point_release_recovery_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/project-runner/internal/projectrunner/pause_point_release_recovery_test.go b/cli/project-runner/internal/projectrunner/pause_point_release_recovery_test.go index 1a47cfd35..a45489571 100644 --- a/cli/project-runner/internal/projectrunner/pause_point_release_recovery_test.go +++ b/cli/project-runner/internal/projectrunner/pause_point_release_recovery_test.go @@ -15,7 +15,7 @@ import ( // Verifies the automatic Debug-switch warning gives the exact approved persistence guidance. func TestPausePointAutoDebugSwitchWarningRecommendsApprovedStartupCommand(t *testing.T) { - const expected = "Code Optimization was Release; switched to Debug and recompiled before arming the pause point. This setting reverts on every Editor restart, and each re-switch costs a full script recompile. Once the current task reaches a natural stopping point, suggest making Debug permanent: with the user's approval, run uloop set-code-optimization debug --startup (machine-wide: applies to every Unity project on this machine; only your project's C# script execution slows down, mainly during Play Mode - the Unity Editor itself is not slowed)." + const expected = "Code Optimization was Release; switched to Debug and recompiled before arming the pause point. On every Editor restart the setting goes back to the 'Code Optimization On Startup' preference (Release unless that preference was changed), and each re-switch costs a full script recompile. Once the current task reaches a natural stopping point, suggest making Debug permanent: with the user's approval, run uloop set-code-optimization debug --startup (machine-wide: applies to every Unity project on this machine; only your project's C# script execution slows down, mainly during Play Mode - the Unity Editor itself is not slowed)." if pausePointAutoDebugSwitchWarning != expected { t.Fatalf("warning = %q, want %q", pausePointAutoDebugSwitchWarning, expected) } From 0c4b84d194d4e414a3a518400e43a7744ac5e446 Mon Sep 17 00:00:00 2001 From: hatayama Date: Thu, 8 Oct 2026 08:41:12 +0900 Subject: [PATCH 2/3] Say the Debug switch goes back to the startup preference on restart The session value set through CompilationPipeline is replaced at startup by the per-user Code Optimization On Startup preference, which defaults to Release but may be Debug, so the warning now names that preference instead of saying the setting reverts. --- .../internal/projectrunner/pause_point_release_recovery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/project-runner/internal/projectrunner/pause_point_release_recovery.go b/cli/project-runner/internal/projectrunner/pause_point_release_recovery.go index b272c5cc5..a1c55437f 100644 --- a/cli/project-runner/internal/projectrunner/pause_point_release_recovery.go +++ b/cli/project-runner/internal/projectrunner/pause_point_release_recovery.go @@ -16,7 +16,7 @@ import ( const pausePointReleaseCodeOptimizationErrorCode = "PAUSE_POINT_RELEASE_CODE_OPTIMIZATION" -const pausePointAutoDebugSwitchWarning = "Code Optimization was Release; switched to Debug and recompiled before arming the pause point. This setting reverts on every Editor restart, and each re-switch costs a full script recompile. Once the current task reaches a natural stopping point, suggest making Debug permanent: with the user's approval, run uloop set-code-optimization debug --startup (machine-wide: applies to every Unity project on this machine; only your project's C# script execution slows down, mainly during Play Mode - the Unity Editor itself is not slowed)." +const pausePointAutoDebugSwitchWarning = "Code Optimization was Release; switched to Debug and recompiled before arming the pause point. On every Editor restart the setting goes back to the 'Code Optimization On Startup' preference (Release unless that preference was changed), and each re-switch costs a full script recompile. Once the current task reaches a natural stopping point, suggest making Debug permanent: with the user's approval, run uloop set-code-optimization debug --startup (machine-wide: applies to every Unity project on this machine; only your project's C# script execution slows down, mainly during Play Mode - the Unity Editor itself is not slowed)." const pausePointRecoveryCompileBusyRetryInterval = 2 * time.Second From e3d83b39564f76add359506a8744a3b992782559 Mon Sep 17 00:00:00 2001 From: hatayama Date: Thu, 8 Oct 2026 08:41:40 +0900 Subject: [PATCH 3/3] Describe the restart behavior of the Debug switch as the startup preference The skill reference, the soak-testing doc, and a code comment said the setting reverts, is lost, or returns to the project's setting. Unity restores the per-user Code Optimization On Startup preference instead, which can itself be Debug. --- .../PausePoint/Skill/references/troubleshooting.md | 2 +- .../FirstPartyTools/PausePoint/SourcePausePointConstants.cs | 5 +++-- docs/soak-testing.md | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/references/troubleshooting.md b/Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/references/troubleshooting.md index dbe447522..3e5bdd482 100644 --- a/Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/references/troubleshooting.md +++ b/Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/references/troubleshooting.md @@ -95,4 +95,4 @@ interrupt the flow or ask the user about it mid-run. At the next stopping point propose `uloop set-code-optimization debug --startup` (session-only without `--startup`), and only apply it if the user approves. -The automatic Debug switch changes only the current project's code optimization for this Editor session; it reverts on every Editor restart, and each re-switch costs a full script recompile. `uloop set-code-optimization debug --startup` makes Debug the startup default through a machine-wide Unity preference that applies to every project. Only the project's C# scripts run slower, mainly in Play Mode - the Editor itself is not slowed. +The automatic Debug switch changes the code optimization of this Editor session only; on every Editor restart it goes back to the 'Code Optimization On Startup' preference (a per-user Unity preference, Release unless changed), and each re-switch costs a full script recompile. `uloop set-code-optimization debug --startup` makes Debug the startup default through a machine-wide Unity preference that applies to every project. Only the project's C# scripts run slower, mainly in Play Mode - the Editor itself is not slowed. diff --git a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs index 02466dc35..c16fba148 100644 --- a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs +++ b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs @@ -246,8 +246,9 @@ internal static class SourcePausePointConstants // not to correct the path or the line syntax as RESOLVE_FAILED asks. public const string ErrorCodePausePointLineNotCompiled = "PAUSE_POINT_LINE_NOT_COMPILED"; - // Why: Debug mode is lost on every Editor restart (including uloop launch -r), so the - // recovery steps must remind callers to re-switch after restart rather than only once. + // Why: Debug mode goes back to the 'Code Optimization On Startup' preference on every + // Editor restart (including uloop launch -r), so the recovery steps must remind callers + // to re-switch after restart rather than only once. public const string ReleaseCodeOptimizationRecommendedNextAction = "Automatic Debug switch and recompile did not succeed. Confirm Code Optimization is Debug " + "(the bug icon in the main toolbar), run uloop compile, then retry enable-pause-point. " diff --git a/docs/soak-testing.md b/docs/soak-testing.md index 013e6bd67..3acc06cde 100644 --- a/docs/soak-testing.md +++ b/docs/soak-testing.md @@ -169,7 +169,8 @@ mode at setup, switches it to Debug if needed, and restores the original mode when the run ends. The mode does **not** survive `uloop launch -r`: an editor restarted mid-soak -comes back on the project's own setting, measured going from Debug to Release +comes back on the per-user 'Code Optimization On Startup' preference (Unity's +EditorPrefs, Release unless changed), measured going from Debug to Release across one restart. Debug is therefore re-applied after every scheduled and recovery restart, the same way the soak scene is rebuilt there. Both switches trigger a full recompile — the setup compile absorbs the first one by retrying past `Compilation is already in progress`,