GeezerVison is showing github.com — perf(windows): optimize Windows on ARM performance and native update support by mweinbach · Pull Request #18508 · pingdotgg/t3code
Conversation
Problem
On Windows and Windows on ARM (win32-arm64), T3 Code suffers from severe responsiveness bottlenecks, high background CPU/IPC overhead, slow startup, and update/provider issues that push x64 builds onto ARM hosts or fail on ARM64 installations:
- Port discovery WMI polling:
PortScanner spawns powershell.exe Get-NetTCPConnection + Get-Process every 3 seconds even when no terminals are active, taking up to 22.5s and timing out at 5s on every poll.
- Main-thread FFI overhead in
@ff-labs/fff-node: Workspace file searches perform 7 separate FFI calls plus manual char-by-char pointer reads per result (175,000+ FFI calls for 25k files), stalling the server event loop for >4s and causing WebSocket ping disconnects.
- Synchronous SQLite WAL commits:
Sqlite.ts enables journal_mode = WAL with the default synchronous = FULL, invoking FlushFileBuffers() on every EventSink.write transaction on Windows.
- Duplicate startup shell environment probes & Android SDK
PATH scans: The server re-runs synchronous PowerShell login probes even when the desktop parent already prepared the environment, mergeWindowsEnv leaves colliding Path/PATH keys, and LocalDeviceHost scans every PATH directory before checking %LOCALAPPDATA%\Android\Sdk.
- Renderer IPC storm during streaming:
SnapShotCoordinator recreates drain whenever activeThreadRef updates, firing desktop:list-pending-snap-shots on every streaming turn update.
- Full-system PEB process enumeration in
t3-resource-monitor: On Windows, sysinfo::ProcessRefreshKind::everything() reads PEB command lines, memory, and disk I/O for every process on the machine every 2 seconds instead of only tracked PIDs.
- Windows terminal teardown hangs & console window flashes:
node-pty's conpty_console_list_agent only listens for message and hangs for 5s if the helper exits early, Manager.runKillEscalation sleeps for the full grace period after exit, and detached helper spawns flash console windows.
- Windows on ARM updates & provider installs:
NsisUpdater checks process.arch ("x64" under Prism emulation) or falls back to the first manifest entry, keeping emulated installs on x64 or pushing x64 updates to ARM hosts; DesktopEnvironment ignores runningUnderArm64Translation on win32; .github/workflows/release.yml falls back to an x64-only latest.yml/nightly.yml if the arm64 manifest is missing; ACP Registry providers lack a windows-aarch64 -> windows-x86_64 Prism fallback; and CodexInstallation can hit GNU tar path parsing or transient Windows file-lock rename failures after validation.
Change
- PortScanner: Short-circuit in
0ms when targetPids is empty and replace Get-NetTCPConnection PowerShell WMI polling with concurrent netstat.exe -ano -p tcp / tcpv6 calls (~50ms).
@ff-labs/fff-node patch: Marshal string fields via DataType.String in a single struct return and skip per-item get_score FFI calls when count > 200, cutting 25k-item queries from 4.16s to ~1.12s.
- SQLite WAL: Set
PRAGMA synchronous = NORMAL; alongside PRAGMA journal_mode = WAL;.
- Startup & device discovery: Respect
shellEnvironmentPrepared: true on win32, run shellEnvironment.installIntoProcess concurrently with electronApp.whenReady, deduplicate Path/PATH keys in mergeWindowsEnv, check standard Android SDK locations before scanning PATH, and skip no-op DeviceService.refreshHosts runs.
- SnapShotCoordinator: Stabilize
drain with a ref so streaming thread state updates do not trigger listPendingSnapShots IPC calls.
t3-resource-monitor: Enable two-stage process refresh on Windows (ProcessRefreshKind::nothing().with_cpu() across the system, then everything() only for tracked PIDs) and resolve target-triple binary paths in ResourceMonitorBinary.ts.
- Terminals & process spawning: Handle
exit/error on conpty_console_list_agent in node-pty, race process.onExit against processKillGraceMs in Manager.ts, remove the redundant 1s Windows teardown sleep in OpenCodeRuntime.ts, and pass windowsHide: true on detached spawns.
- Windows on ARM updates & providers:
- Preserve
runningUnderArm64Translation and hostArch: "arm64" on win32 in DesktopEnvironment.ts so DesktopUpdates disables differential downloads when switching from x64 to arm64.
- Filter
updateInfo.files to hostArch in DesktopUpdates.ts (ignoring manifests that carry no package for hostArch) and add NsisUpdater.filterFilesForArch in patches/[email protected] so ARM64 Windows hosts always select arm64.exe.
- Order
arm64 first when merging Windows update manifests in .github/workflows/release.yml and fail if the arm64 manifest is missing instead of publishing an x64-only manifest.
- Add the Windows
arm64.exe download link to /download and update the architecture warning copy for Windows on ARM.
- Fall back from
windows-aarch64 to windows-x86_64 in AcpRegistrySupport.ts, and use System32\tar.exe plus fs.rename retries and stale .install-* cleanup in CodexInstallation.ts.
Model: Claude 5.5 Opus
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-12T05:05:10.353476Z |
093e451 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note This comment is posted by Julius' dot
Closing because this combines independent fixes: replacing PortScanner polling, reducing file-search FFI calls, and selecting ARM64 update packages each solves a separate problem without needing the others. Please split these into focused PRs under the one-problem rule, with reproduction steps and verification for each. Discuss the separate SQLite synchronous-mode default change with maintainers before including it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Not approved
Macroscope's review found this PR not approvable — This PR introduces broad Windows-on-ARM runtime, updater, provider, terminal, monitoring, release, and dependency behavior changes across the product. It also changes the SQLite persistence default to synchronous = NORMAL, making the change unsuitable for automatic approval.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 093e451ce6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+13
to
+17
|
|
const hostArch =
|
|
|
hostPlatform === "win32" &&
|
|
|
rawHostArch === "x64" &&
|
|
|
process.env.PROCESSOR_ARCHITEW6432?.toUpperCase() === "ARM64"
|
|
|
? "arm64"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep Electron aligned with the installed native modules
On an ARM64 Windows machine running an x64 Node toolchain, this changes only the architecture of a repaired Electron runtime: pnpm still treats current as x64 (pnpm-workspace.yaml:334-337), and native modules such as node-pty and ffi-rs are therefore installed or built for x64. If ensureElectronRuntime() repairs a missing or invalid runtime, it now downloads arm64 Electron, which is also used as the backend Node executable by DesktopBackendConfiguration.ts; loading those x64 addons from that process then fails with an architecture mismatch. Either keep the repair on rawHostArch or provision/rebuild every native dependency for arm64 as part of the switch.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+229
to
+233
|
|
useEffect(() => {
|
|
|
if (currentTarget) {
|
|
|
lastTargetRef.current = currentTarget;
|
|
|
}
|
|
|
latestContextRef.current = {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update snapshot routing before passive effects
When navigation commits, the existing bridge listener remains subscribed because its dependencies are now stable, but both lastTargetRef and latestContextRef retain the previous route until this passive effect runs. If a requested or ready desktop IPC event arrives after the new thread commits but before passive effects flush, the capture can be pinned or delivered to the thread the user just left. Update these refs with a layout-synchronous or event-ref primitive while preserving the stable callback identities.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 12, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XL
500-999 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|