[PR #2467] [MERGED] fix(windows): preserve transient runtime admission failures #5250

Closed
opened 2026-10-31 01:05:08 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2467
Author: @N0zoM1z0
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/windows-native-transient-retry-2257


📝 Commits (2)

  • 2c7a09e fix(windows): preserve transient runtime admission failures
  • 255943f docs(windows): record runtime retry integration replay

📊 Changes

20 files changed (+491 additions, -62 deletions)

View changed files

➕ experiments/analysis-efficiency/windows-runtime-retry.md (+107 -0)
📝 native/windows/README.md (+11 -0)
📝 native/windows/src/addon.cc (+2 -0)
📝 native/windows/src/authority.hpp (+2 -0)
📝 native/windows/src/filesystem.cc (+6 -1)
📝 scripts/verify-windows-native.mjs (+33 -0)
📝 src/domain/analysisErrorCore.ts (+7 -1)
📝 src/domain/analysisErrorPresentation.ts (+7 -0)
📝 src/domain/analysisErrorProjection.test.ts (+85 -0)
📝 src/domain/analysisErrorProjection.ts (+2 -0)
📝 src/javascript/analysis/JavaScriptAnalysisWorker.ts (+3 -5)
📝 src/javascript/sourceMaps/SourceMapCommand.ts (+3 -5)
📝 src/process/PrivateRuntimeRoot.ts (+4 -11)
➕ src/process/PrivateRuntimeRootUnavailableError.ts (+14 -0)
📝 src/process/WindowsAuthority.ts (+2 -0)
📝 src/wasm/WabtArtifactProvider.test.ts (+44 -34)
📝 src/wasm/WabtFailures.ts (+2 -2)
📝 src/windows/WindowsPrivateRuntime.ts (+23 -3)
➕ tests/boundary/javascript/sourceMapRuntimeAvailability.test.ts (+35 -0)
➕ tests/process-global/windowsRuntimeAdmission.test.ts (+99 -0)

📄 Description

Summary

Fixes #2257. Follow-up to the transient native self-test diagnosis in #2266; thanks to @chqcjq for that investigation.

  • Preserve an explicitly retryable native-readiness failure through private runtime acquisition and JavaScript, source-map and WABT analysis error projection.
  • Handle the same real sharing conflict after successful authority caching. The native producer supplies affirmative runtimeAllocation: "not-started" evidence only for failed parent admission, before directory creation; the adapter requires that evidence and exact numeric Win32 32/33 codes.
  • Keep permission errors, opaque messages and unknown allocation state nonretryable. Incomplete cleanup takes precedence, retaining owned resource facts and the original cause.
  • Give transient analysis failures category: unavailable and an appropriate retry instruction. No automatic retries, extra engine calls or new analysis cache.
  • Add an unconditional real-kernel admission regression to the existing Windows native verifier. Move the generic acquisition error to its own leaf module and update all affected consumers.

Verification

Real Windows 11 (10.0.22631.0), official Windows x64 Node 24.18.0, locked production dependencies, official npm 11.16.0 launcher sources as the real application input:

  • CLI normal analysis, actual kernel sharing conflict, release and recovery. Before the fix the failure was unsupported_provider / retryable: false; the correction preserves the reason and reports unavailable / retryable: true.
  • SDK 2.3.1 stdio MCP: normal analysis, warm conflict after authority caching and successful recovery on the same connection. No residual runtime directories.
  • Baseline/candidate CLI normalized-result SHA-256 matches: a24d3c2d9897cccc5ba70e9ee4dce03da88f033a939fe87457136fc5b3a3e2db.
  • Full real native verifier passes, including the new pre-allocation proof case. Its optional independently built process-boundary fixture was not supplied.
  • 99 related tests pass, covering projection, cleanup precedence, runtime admission boundaries, loader behavior, worker cancellation/ownership, source-map and WABT disposition propagation. Injected acquisition failures do not establish real source-map or WABT engine execution.
  • Pinned runtime build, static gate, test-discovery and documentation checks.

No IDA or Ghidra engine was used for this runtime fix. Thirty baseline native self-tests passed: Win32 5 from #1701/#2196 was not reproduced on this host and is not claimed fixed.

Efficiency and limits

Measurements and source pins: experiments/analysis-efficiency/windows-runtime-retry.md.

The successful analysis reply remains unchanged within the tested comparison. The warm error reply decreases from 1,218 to 878 serialized bytes. Complete MCP discovery cost 2,498,686 bytes in the paired source comparison; after upstream Android/SAZ changes, the integration replay discovers 2,517,904 bytes. Bytes are not model tokens; actual model usage was not measured. One controlled process-family run observed a sampled working-set sum of about 694 MiB and a CPU-time lower bound of 26.8 seconds; there is no paired resource baseline and no speedup or resource-saving claim. Heavy verification runs used low priority, one CPU and bounded Node heaps. Only owned intermediate files are cleaned.

Main integration

Rebased onto main a2d8b94dd. The integrated runtime again passed 99 related tests, static/documentation checks and real Windows CLI plus same-connection MCP conflict/recovery. CLI result hashes and MCP successful/error reply sizes remain unchanged; upstream catalogue changes are recorded separately from this fix.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2467 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/windows-native-transient-retry-2257` --- ### 📝 Commits (2) - [`2c7a09e`](https://github.com/morluto/rea/commit/2c7a09eaf3ffe26667b40081f1cf0fd2ce44a146) fix(windows): preserve transient runtime admission failures - [`255943f`](https://github.com/morluto/rea/commit/255943fbbf91961240af16bc2c1f9c8f894d66cc) docs(windows): record runtime retry integration replay ### 📊 Changes **20 files changed** (+491 additions, -62 deletions) <details> <summary>View changed files</summary> ➕ `experiments/analysis-efficiency/windows-runtime-retry.md` (+107 -0) 📝 `native/windows/README.md` (+11 -0) 📝 `native/windows/src/addon.cc` (+2 -0) 📝 `native/windows/src/authority.hpp` (+2 -0) 📝 `native/windows/src/filesystem.cc` (+6 -1) 📝 `scripts/verify-windows-native.mjs` (+33 -0) 📝 `src/domain/analysisErrorCore.ts` (+7 -1) 📝 `src/domain/analysisErrorPresentation.ts` (+7 -0) 📝 `src/domain/analysisErrorProjection.test.ts` (+85 -0) 📝 `src/domain/analysisErrorProjection.ts` (+2 -0) 📝 `src/javascript/analysis/JavaScriptAnalysisWorker.ts` (+3 -5) 📝 `src/javascript/sourceMaps/SourceMapCommand.ts` (+3 -5) 📝 `src/process/PrivateRuntimeRoot.ts` (+4 -11) ➕ `src/process/PrivateRuntimeRootUnavailableError.ts` (+14 -0) 📝 `src/process/WindowsAuthority.ts` (+2 -0) 📝 `src/wasm/WabtArtifactProvider.test.ts` (+44 -34) 📝 `src/wasm/WabtFailures.ts` (+2 -2) 📝 `src/windows/WindowsPrivateRuntime.ts` (+23 -3) ➕ `tests/boundary/javascript/sourceMapRuntimeAvailability.test.ts` (+35 -0) ➕ `tests/process-global/windowsRuntimeAdmission.test.ts` (+99 -0) </details> ### 📄 Description ## Summary Fixes #2257. Follow-up to the transient native self-test diagnosis in #2266; thanks to @chqcjq for that investigation. - Preserve an explicitly retryable native-readiness failure through private runtime acquisition and JavaScript, source-map and WABT analysis error projection. - Handle the same real sharing conflict after successful authority caching. The native producer supplies affirmative `runtimeAllocation: "not-started"` evidence only for failed parent admission, before directory creation; the adapter requires that evidence and exact numeric Win32 32/33 codes. - Keep permission errors, opaque messages and unknown allocation state nonretryable. Incomplete cleanup takes precedence, retaining owned resource facts and the original cause. - Give transient analysis failures `category: unavailable` and an appropriate retry instruction. No automatic retries, extra engine calls or new analysis cache. - Add an unconditional real-kernel admission regression to the existing Windows native verifier. Move the generic acquisition error to its own leaf module and update all affected consumers. ## Verification Real Windows 11 (10.0.22631.0), official Windows x64 Node 24.18.0, locked production dependencies, official npm 11.16.0 launcher sources as the real application input: - CLI normal analysis, actual kernel sharing conflict, release and recovery. Before the fix the failure was `unsupported_provider` / `retryable: false`; the correction preserves the reason and reports `unavailable` / `retryable: true`. - SDK 2.3.1 stdio MCP: normal analysis, warm conflict after authority caching and successful recovery on the **same connection**. No residual runtime directories. - Baseline/candidate CLI normalized-result SHA-256 matches: `a24d3c2d9897cccc5ba70e9ee4dce03da88f033a939fe87457136fc5b3a3e2db`. - Full real native verifier passes, including the new pre-allocation proof case. Its optional independently built process-boundary fixture was not supplied. - 99 related tests pass, covering projection, cleanup precedence, runtime admission boundaries, loader behavior, worker cancellation/ownership, source-map and WABT disposition propagation. Injected acquisition failures do not establish real source-map or WABT engine execution. - Pinned runtime build, static gate, test-discovery and documentation checks. No IDA or Ghidra engine was used for this runtime fix. Thirty baseline native self-tests passed: Win32 5 from #1701/#2196 was **not reproduced** on this host and is not claimed fixed. ## Efficiency and limits Measurements and source pins: [`experiments/analysis-efficiency/windows-runtime-retry.md`](https://github.com/morluto/rea/blob/255943fbbf91961240af16bc2c1f9c8f894d66cc/experiments/analysis-efficiency/windows-runtime-retry.md). The successful analysis reply remains unchanged within the tested comparison. The warm error reply decreases from 1,218 to 878 serialized bytes. Complete MCP discovery cost 2,498,686 bytes in the paired source comparison; after upstream Android/SAZ changes, the integration replay discovers 2,517,904 bytes. Bytes are not model tokens; actual model usage was not measured. One controlled process-family run observed a sampled working-set sum of about 694 MiB and a CPU-time lower bound of 26.8 seconds; there is no paired resource baseline and no speedup or resource-saving claim. Heavy verification runs used low priority, one CPU and bounded Node heaps. Only owned intermediate files are cleaned. ## Main integration Rebased onto main `a2d8b94dd`. The integrated runtime again passed 99 related tests, static/documentation checks and real Windows CLI plus same-connection MCP conflict/recovery. CLI result hashes and MCP successful/error reply sizes remain unchanged; upstream catalogue changes are recorded separately from this fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5250
No description provided.