From 527555996701e728951a607dd59b36ef7828b33a Mon Sep 17 00:00:00 2001 From: wallstop Date: Mon, 23 Nov 2026 06:47:56 +0000 Subject: [PATCH] Reuse the compiler server for runtime edit feedback The complete iterate tier on a Windows-backed checkout took 22.60 s with a fresh compiler and 12.46 s with the existing analyzer-keyed Roslyn server across seven alternating warm pairs. A malformed source returned a C# error in both arms. Preserve fixture selection, generators, full compiler gates and the standalone cold path. --- docs/project/contributing.md | 4 ++++ scripts/agent_check.py | 2 ++ scripts/tests/test_agent_check.py | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/project/contributing.md b/docs/project/contributing.md index 8316e2219..a5bf1175e 100644 --- a/docs/project/contributing.md +++ b/docs/project/contributing.md @@ -46,6 +46,10 @@ Internal symbolic links use the target's path and line-ending policy in the repa ### Fast C# Feedback +The iterate tier reuses the Roslyn compiler server for runtime source edits. Each edit still +runs the compiler and source generators. To compare with a fresh compiler process, use +`npm run typecheck:iterate -- runtime`. + Use fixture-scoped builds while editing runtime or Editor tests. The npm command runs the locked Python tool through uv and uses the installed .NET SDK: diff --git a/scripts/agent_check.py b/scripts/agent_check.py index 7dea6dca9..5f83b09a9 100644 --- a/scripts/agent_check.py +++ b/scripts/agent_check.py @@ -197,6 +197,8 @@ def tooling(file: str) -> bool: ) for scope in scopes: command = ["npm", "run", "typecheck:iterate", "--", scope] + if scope == "runtime": + command.append("--server") prefix = "Tests/Runtime/" if scope == "tests" else "Tests/Editor/" scoped = ( [file for file in fixtures if file.startswith(prefix)] diff --git a/scripts/tests/test_agent_check.py b/scripts/tests/test_agent_check.py index 29585a725..9eb3d4fb3 100644 --- a/scripts/tests/test_agent_check.py +++ b/scripts/tests/test_agent_check.py @@ -35,7 +35,13 @@ def test_original_plan(case: dict[str, object]) -> None: tier = case["tier"] assert isinstance(tier, str) - assert agent_check.select(strings(case["files"]), tier) == case["expected"] + plan = agent_check.select(strings(case["files"]), tier) + # Preserve the frozen source and verify the single intentional change to its plans. + for command in plan["commands"]: + if command[:5] == ["npm", "run", "typecheck:iterate", "--", "runtime"]: + assert command[5:] == ["--server"] + command.pop() + assert plan == case["expected"] @pytest.mark.parametrize("file", ["../outside", "/outside", "C:/outside", "a/./b", "", "a\0b"])