From a74653036b2af30c2e8192a1c6cf0850439540bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20=C5=A0olt=C3=A9s?= Date: Sun, 20 Sep 2026 13:27:29 +0200 Subject: [PATCH] fix: restore native runtime package CI portability --- .github/workflows/native-runtime-packages.yml | 4 ++- docs/validation/runtime-ci-bootstrap-819.md | 35 +++++++++++++++++++ eng/graphics/tests/test_dawn_exports.py | 4 ++- .../native/webscene_v8_runtime.cpp | 3 +- .../webscene_v8_runtime_service_workers.inc | 3 +- scripts/tests/test_v8_bootstrap_literals.py | 17 +++++++++ 6 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 docs/validation/runtime-ci-bootstrap-819.md diff --git a/.github/workflows/native-runtime-packages.yml b/.github/workflows/native-runtime-packages.yml index 270de2d4a..1b67d0764 100644 --- a/.github/workflows/native-runtime-packages.yml +++ b/.github/workflows/native-runtime-packages.yml @@ -35,6 +35,7 @@ on: - 'scripts/tests/test_prepare_dotnet_install.py' - 'scripts/tests/test_prepare_runner_disk.py' - 'scripts/tests/test_verify_cross_rid_compatibility.py' + - 'scripts/tests/test_v8_bootstrap_literals.py' - 'scripts/tests/test_v8_windows_environment.ps1' - 'scripts/verify-release-packages.py' - 'src/WebScene.Backend.Abstractions/**' @@ -76,7 +77,8 @@ jobs: scripts/tests/test_native_runtime_workflow_policy.py \ scripts/tests/test_prepare_dotnet_install.py \ scripts/tests/test_prepare_runner_disk.py \ - scripts/tests/test_verify_cross_rid_compatibility.py + scripts/tests/test_verify_cross_rid_compatibility.py \ + scripts/tests/test_v8_bootstrap_literals.py - name: Repair incomplete .NET install shell: bash env: diff --git a/docs/validation/runtime-ci-bootstrap-819.md b/docs/validation/runtime-ci-bootstrap-819.md new file mode 100644 index 000000000..30e50ada6 --- /dev/null +++ b/docs/validation/runtime-ci-bootstrap-819.md @@ -0,0 +1,35 @@ +# Native Runtime CI bootstrap repair (#819) + +WebScene main at `795551990872aaa4d6af9224648c61af7d4c8276` could not +produce Windows or Linux Runtime packages. The final raw JavaScript literal in +`install_editor_web_platform_globals` had grown to 16,539 UTF-8 bytes, beyond +the 15,000-byte portability ceiling that keeps MSVC below C2026's 16,380-byte +literal limit. The same main commit's general CI also used a stale Windows Dawn +export fixture that omitted the required `websceneDawnQueryD3D12DeviceV1` +bridge. + +Wiring the existing portability test into the producer preflight also exposed a +15,203-byte Service Worker bootstrap literal. It is split through the same +ordered concatenation path, making the gate cover every currently known +bootstrap family instead of excluding an existing violation. + +The editor bootstrap now splits at a complete statement boundary and continues +to use the existing ordered `source_parts` concatenation. The snapshot extractor +and runtime therefore receive the same JavaScript program without increasing +the compiler-safety limit or changing browser behavior. A focused test checks +every editor-platform part against the limit and compares the ordered join with +the extractor output. The native package workflow executes that test before +starting any RID build. + +The Windows symbol fixture now contains the exact D3D12 bridge export already +required by the production verifier. This changes test evidence only; it does +not broaden the accepted export surface. + +Authoritative failure evidence: + +- WebScene CI run `35505459474`, Linux graphics boundary job. +- WebScene NuGet run `35505459479`, Windows and Linux Runtime package jobs. + +The AppScene SDK producer must use the WebScene merge commit containing this +repair. The cancelled producer run `35507539063` still points at the broken +WebScene revision and cannot be used as release evidence. diff --git a/eng/graphics/tests/test_dawn_exports.py b/eng/graphics/tests/test_dawn_exports.py index 9c552a56c..baca966f3 100644 --- a/eng/graphics/tests/test_dawn_exports.py +++ b/eng/graphics/tests/test_dawn_exports.py @@ -23,7 +23,9 @@ def test_native_symbol_formats(self): "00001040 T websceneDawnQueryVulkanDeviceV3\n" "00001050 T websceneDawnAcquireVulkanQueueV3\n" "00001060 T websceneDawnReleaseVulkanQueueV3\n"), - ("win-x64", " 1 0 00001000 wgpuCreateInstance\n 2 1 00001010 wgpuGetProcAddress\n")]: + ("win-x64", " 1 0 00001000 wgpuCreateInstance\n" + " 2 1 00001010 wgpuGetProcAddress\n" + " 3 2 00001020 websceneDawnQueryD3D12DeviceV1\n")]: with self.subTest(rid=rid): self.assertEqual(self.inspect(text, rid)["status"], "passed") diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime.cpp b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime.cpp index 947702f8c..6e3d11989 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime.cpp +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime.cpp @@ -3980,7 +3980,8 @@ struct v8_dom_runtime::implementation final { } walkElements(root, upgradeElement); }, writable: true, configurable: true } - }); + });)JS", + R"JS( Object.defineProperty(document, 'createElement', { value(...args) { diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_service_workers.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_service_workers.inc index f47e8474b..ca561743b 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_service_workers.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_service_workers.inc @@ -1118,7 +1118,8 @@ } } const caches = Object.create(CacheStorage.prototype); - cacheStorageState.set(caches, {wrappers:new Map()}); + cacheStorageState.set(caches, {wrappers:new Map()});)JS", + R"JS( function Client() { throw new TypeError('Illegal constructor'); } function WindowClient() { throw new TypeError('Illegal constructor'); } function Clients() { throw new TypeError('Illegal constructor'); } diff --git a/scripts/tests/test_v8_bootstrap_literals.py b/scripts/tests/test_v8_bootstrap_literals.py index 6815e49e2..c7d8af81a 100644 --- a/scripts/tests/test_v8_bootstrap_literals.py +++ b/scripts/tests/test_v8_bootstrap_literals.py @@ -37,6 +37,23 @@ class V8BootstrapLiteralTests(unittest.TestCase): + def test_editor_platform_bootstrap_is_portable_and_byte_equivalent(self) -> None: + source = RUNTIME_PATH.read_text(encoding="utf-8") + marker = "void install_editor_web_platform_globals" + parts = EXTRACTOR.extract_parts(source, marker) + + self.assertGreater(len(parts), 6) + self.assertTrue( + all( + len(part.encode("utf-8")) <= EXTRACTOR.MAX_RAW_LITERAL_BYTES + for part in parts + ) + ) + self.assertEqual( + "".join(parts).strip() + "\n", + EXTRACTOR.extract(source, marker), + ) + def test_fetch_bootstrap_is_portable_and_byte_equivalent(self) -> None: source = RUNTIME_PATH.read_text(encoding="utf-8") parts = EXTRACTOR.extract_parts(source, "void install_fetch_globals")