@forgeax/engine-naga 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +18 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +118 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/naga.unit.test.ts +128 -29
- package/src/__tests__/reflect-uv-set-count.test.ts +63 -10
- package/src/index.ts +164 -10
package/dist/.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/@webgpu+types@0.1.71/node_modules/@webgpu/types/dist/index.d.ts","../../types/dist/animation-target.d.ts","../../types/dist/asset-errors.d.ts","../../types/dist/result.d.ts","../../types/dist/asset-evidence.d.ts","../../types/dist/asset.d.ts","../../types/dist/asset-runtime.d.ts","../../types/dist/material/color-space.d.ts","../../types/dist/material/asset.d.ts","../../types/dist/vfx.d.ts","../../types/dist/handle.d.ts","../../types/dist/material/errors.d.ts","../../types/dist/material/resolve.d.ts","../../types/dist/material/index.d.ts","../../types/dist/asset-producer.d.ts","../../types/dist/catalog.d.ts","../../types/dist/runtime-scope.d.ts","../../types/dist/derive-paramschema.d.ts","../../types/dist/import.d.ts","../../types/dist/index.d.ts","../src/errors.ts","../../wgpu-wasm/pkg/wgpu_wasm.d.ts","../../wgpu-wasm/dist/index.d.ts","../src/index.ts","../../../node_modules/.pnpm/@vitest+pretty-format@4.1.5/node_modules/@vitest/pretty-format/dist/index.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/display.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/types.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/helpers.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/timers.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/index.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/diff.d.ts","../../../node_modules/.pnpm/@vitest+runner@4.1.5/node_modules/@vitest/runner/dist/tasks.d-Bh0IjN67.d.ts","../../../node_modules/.pnpm/@vitest+runner@4.1.5/node_modules/@vitest/runner/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/traces.d.D2T_R8rx.d.ts","../../../node_modules/.pnpm/vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7/node_modules/vite/types/hmrPayload.d.ts","../../../node_modules/.pnpm/vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts","../../../node_modules/.pnpm/vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7/node_modules/vite/types/customEvent.d.ts","../../../node_modules/.pnpm/vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7/node_modules/vite/types/hot.d.ts","../../../node_modules/.pnpm/vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7/node_modules/vite/dist/node/module-runner.d.ts","../../../node_modules/.pnpm/@vitest+snapshot@4.1.5/node_modules/@vitest/snapshot/dist/environment.d-DOJxxZV9.d.ts","../../../node_modules/.pnpm/@vitest+snapshot@4.1.5/node_modules/@vitest/snapshot/dist/rawSnapshot.d-D_X3-62x.d.ts","../../../node_modules/.pnpm/@vitest+snapshot@4.1.5/node_modules/@vitest/snapshot/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/config.d.A1h_Y6Jt.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/environment.d.CrsxCzP1.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/rpc.d.B_8sPU0w.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/worker.d.ZpHpO4yb.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/browser.d.BcoexmFG.d.ts","../../../node_modules/.pnpm/@vitest+spy@4.1.5/node_modules/@vitest/spy/optional-types.d.ts","../../../node_modules/.pnpm/@vitest+spy@4.1.5/node_modules/@vitest/spy/dist/index.d.ts","../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.d.ts","../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","../../../node_modules/.pnpm/assertion-error@2.0.1/node_modules/assertion-error/index.d.ts","../../../node_modules/.pnpm/@types+chai@5.2.3/node_modules/@types/chai/index.d.ts","../../../node_modules/.pnpm/@vitest+expect@4.1.5/node_modules/@vitest/expect/dist/index.d.ts","../../../node_modules/.pnpm/@vitest+runner@4.1.5/node_modules/@vitest/runner/dist/utils.d.ts","../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/benchmark.d.DAaHLpsq.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/global.d.DVsSRdQ5.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/optional-runtime-types.d.ts","../../../node_modules/.pnpm/@vitest+mocker@4.1.5_vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7_/node_modules/@vitest/mocker/dist/types.d-BjI5eAwu.d.ts","../../../node_modules/.pnpm/@vitest+mocker@4.1.5_vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7_/node_modules/@vitest/mocker/dist/index.d-B41z0AuW.d.ts","../../../node_modules/.pnpm/@vitest+mocker@4.1.5_vite@8.0.10_@types+node@20.19.40_esbuild@0.27.7_jiti@1.21.7_/node_modules/@vitest/mocker/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/suite.d.udJtyAgw.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/runners.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.1.5_@types+node@20.19.40_@vitest+browser-playwright@4.1.5_@vitest+coverage-v8@_93fb3f30d132ee2e785bbc9f718b2231/node_modules/vitest/dist/index.d.ts","../src/__tests__/naga.unit.test.ts","../src/__tests__/reflect-uv-set-count.test.ts"],"fileIdsList":[[112,113],[85,91,109,110,111,114],[121],[121,122],[89,91,92],[89,91],[89],[84,89,100,101],[84,89,100],[108],[84,90],[84],[86],[84,85,86,87,88],[127,128],[127,128,129,130],[127,129],[127],[95],[95,96,97,98],[97],[93,116,117,119],[93,94,106,119],[84,91,93,94,102,119],[99],[84,93,94,102,115,118,119],[93,94,99,102,119],[93,116,117,118,119],[93,99,103,104,105,119],[84,89,91,93,94,99,102,103,104,105,106,107,109,115,116,117,118,119,120,123,124,125,126,131],[84,91,93,94,102,103,116,117,118,119,124],[80,83,132],[83,132],[60,79],[80,82],[62,63,65],[62,63,65,79],[64],[63,65,74],[79],[62,74,75,76,79],[61,62,63,65,66,68,69,70,73,74,75,76,77,78],[66,67,79],[68],[67,68,71,72],[63,68,71],[74,75],[81]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2e5cfb2397ec8cacfd30de0e6f7992eb7db7b02cc83b7c43ef58bcd5aa88bc3","affectsGlobalScope":true,"impliedFormat":1},"89fe170d9a59f81cd9a9d95de3278f108ff91491810b2529cc0ffb502a57b6c0","0b4928041c807c01b33b1fa028236df635c52f7acff5a40f2c2d0d677b53428b","5ad2e5b8b17893d0eb1f11a1b6e8c03b17344be03a6a72a624cd38ab05fe4d5c","6a1e553079e654a1771463e9eeb98ea4f7bb4b6417a5237d4fdf9b546d49647f","7f11be86b9ac5c2cd5127cd9d40ccc7694c58868a3157692a153d452fc171525","8b52dd8be86f44f871db89a6c1f77f7585688d53141ff55b6c5fac3eb67b1241","6e3488ee1183ea915eb43f08aebc5f75e30be25aef1f678d1965324bdd7506e1","59ca967d9cb92088499ce15a1c389e55a39bb2cb905844439565d9f7d8b1ed5d","a318d8734523d9e750681e7b8e685ef817d4049c5612451f4e849da8b2b572a9","99440a4820b8621d65822e29b01afd8a5938ea94ebea634fdd31d32d3e735629","080e7748d9754ccaea8debbc933552c7976c1ef588f9642a6f07e5a4d139d43b","51342c51a9090c0bc8bae60c5ec1a0f46d6d44db84392f12a8cd46e6d8a9f617","ae777307a0baeb9b5d7ba18e6a029a54eb0b612b1491591dcedb020cc8d36f97","d7ba738e316b7baed10ca49cc156b57b8c973b747bec6612e62a925e9f7f33a4","1d5292578fcf0329a43ef19fe2481d7d1cde75e75610019a7897c70dcfff0b31","459b3765e622008ed590474ae6b61ab55107a7b9529a28d05087a6fef51d7248","ce15f7fa66eb0ff73351db6a626a397eb441aa3572707c2a156897c646b2911d","c68fbed241cfa01237d9d15cff9bab1ebdd06f2fe337f536e218c1c39aa5a841","a6fcec9d447e7ea2763d1e5f9cf32a20e7f7cff2fe0da4c48639db063b9cc531",{"version":"94a659763e9d9f96878c6ef8ab16dcf31bc724aaa26b0cad508cd456805a8891","signature":"61b18ed6e181badb438c38ca162ac8935b8d13d1c6f6e56f0f2f63e061e48b60"},"e1189f6ef446a71e336924e21ac773d8744006a5ec7f2bbecb5d275fbd907200","0347b27f786c1ee2e8478351dabcd31f7619dadf575983f7f3c37eeb63a01d8f",{"version":"b8e518276c9d989dfa9c201156b1b3e3ef8d5a9aa4d07993eb906aa14188cad7","signature":"aef269a070b7b1139f5b3835f7af865ff9126db29f507e5d355416749d1e8910"},{"version":"3a582c6e8906f5b094ccf0de6cc6f4f8a54b05a34f52517aba5c9c7f704f6b28","impliedFormat":99},{"version":"0528f6d21f7a02d4092895090d2dd86104bd5a3e79eced96d5a1a7dd90943d17","impliedFormat":99},{"version":"b5ce343886d23392be9c8280e9f24a87f1d7d3667f6672c2fe4aa61fa4ece7d4","impliedFormat":99},{"version":"72ce5b734c05da85c85a6f6dc05823b051d6aa41acaedeeb1d17c72f3b4efa72","impliedFormat":99},{"version":"b0857bb28fd5236ace84280f79a25093f919fd0eff13e47cc26ea03de60a7294","impliedFormat":99},{"version":"5e43e0824f10cd8c48e7a8c5c673638488925a12c31f0f9e0957965c290eb14c","impliedFormat":99},{"version":"ef13c73d6157a32933c612d476c1524dd674cf5b9a88571d7d6a0d147544d529","impliedFormat":99},{"version":"3b0a56d056d81a011e484b9c05d5e430711aaecd561a788bad1d0498aad782c7","impliedFormat":99},{"version":"9443967db823b66d1682be7fc66392be7c7924e10c3e54900f456341e94591a6","impliedFormat":99},{"version":"424f71d1fae96ac2e878af92345bb87bea1d29f757228fbc190133b305643f2c","impliedFormat":99},{"version":"61bb64660ee150f3ab618340e15cca0a81664801bede7c966ca0eca3a952fe63","impliedFormat":99},{"version":"3b89216a7e38a454985ad17bb2ff85792837dc812f2a89fa5f60ad0a2e216fa7","impliedFormat":99},{"version":"16fe60bb544cfedfd2b5bb2f7d0b3957be7978706d57d9f06edc9c0c8dbdba23","impliedFormat":99},{"version":"82179358c2d9d7347f1602dc9300039a2250e483137b38ebf31d4d2e5519c181","impliedFormat":99},{"version":"4e003c868b0d8f8ad200b96cbc653e18e513fa23e1c19c4fe3cc25d4394efc47","impliedFormat":99},{"version":"605450898939e8abce51e8085a41b60640278337a969c33cd6b169e7c4f9c3f2","impliedFormat":99},{"version":"42a12f2faa483c9b48195ed794d22698162274e755f6e07219c2351c4f08d732","impliedFormat":99},{"version":"ec0c42bb0f465e4993f2bc68a6ce9df9a2dcbc7b83e21748f82f1b69561938e3","impliedFormat":99},{"version":"f50ff37a9cbbe74475f426474d9827083c7c2c138a954d28f1690df338f69291","impliedFormat":99},{"version":"61fd6c17235d530c40f543dd7c40afab091d91c1ef890baeed30db6d82b04b28","impliedFormat":99},{"version":"bcbd3becd08b4515225880abea0dbfbbf0d1181ce3af8f18f72f61edbe4febfb","impliedFormat":99},{"version":"091767bc841f937654ed597d49e023ed59850355e746ae1a6f20ab31076ee1fb","impliedFormat":99},{"version":"19c6d6135af59693698d384050b45a8a049493500add442f58e4bd7c8a255ab6","impliedFormat":99},{"version":"6a0dba12d55314638a8c51108b20fe2f68f1364a619d098918bda91c22dec154","impliedFormat":99},{"version":"c76c02846ba7d40b9b3488f0e8d75d02cbdee2f0bc5fcd55dd3bd2e1457646ea","impliedFormat":99},{"version":"4ead13a482c539b77394b2a97e3b877b809eac596390371cea490286f53b996a","impliedFormat":99},{"version":"06db2f8ba1d1dfacf04529cb731081ab23f133f29c7608ebdfbcab356996827c","impliedFormat":99},{"version":"bdd14f07b4eca0b4b5203b85b8dbc4d084c749fa590bee5ea613e1641dcd3b29","impliedFormat":99},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"2eeffcee5c1661ddca53353929558037b8cf305ffb86a803512982f99bcab50d","impliedFormat":99},{"version":"9afb4cb864d297e4092a79ee2871b5d3143ea14153f62ef0bb04ede25f432030","affectsGlobalScope":true,"impliedFormat":99},{"version":"5c935b7fc4ddc1410ea1cd7cd4e35ed106a6e4920dd27a9480a40fd224359dc3","affectsGlobalScope":true,"impliedFormat":99},{"version":"ed9bb55ddcbebd5cb3eee991f57ff21438546ee40ee1c310281bd12a6c7cf65b","impliedFormat":99},{"version":"69bf2422313487956e4dacf049f30cb91b34968912058d244cb19e4baa24da97","impliedFormat":99},{"version":"6987dfb4b0c4e02112cc4e548e7a77b3d9ddfeffa8c8a2db13ceac361a4567d9","impliedFormat":99},{"version":"4ffba3c5848b4fe62ee59b754fd5f256ad9656a0db6d37b9a2a8cb40dfc7ac21","impliedFormat":99},{"version":"c76c02846ba7d40b9b3488f0e8d75d02cbdee2f0bc5fcd55dd3bd2e1457646ea","impliedFormat":99},{"version":"5e2ba3d18d78aebbde1f34bde356e41e9c76eeaeaeee56a37036596a9eff4211","impliedFormat":99},{"version":"8280ae8ccc0493b32d1742d585357ab9f0a508ea050af25a5a20d64010d0a5cf","impliedFormat":99},{"version":"7adfd9f9056ecd4ae6c65fde2a98654960c662714c73f048478959d04c09e144","impliedFormat":99},{"version":"32b35cf0dc3a1b1a7118b61c34ce2ad1a29695851679f9ec34e0776f2ece2a69","impliedFormat":99},{"version":"b413fbc6658fe2774f8bf9a15cf4c53e586fc38a2d5256b3b9647da242c14389","impliedFormat":99},{"version":"59e5e964b84fdb2378e9455e4e59405030e4ed2b4c6f891ce395f17796af3cbb","impliedFormat":99},{"version":"c30a41267fc04c6518b17e55dcb2b810f267af4314b0b6d7df1c33a76ce1b330","impliedFormat":1},{"version":"72422d0bac4076912385d0c10911b82e4694fc106e2d70added091f88f0824ba","impliedFormat":1},{"version":"da251b82c25bee1d93f9fd80c5a61d945da4f708ca21285541d7aff83ecb8200","impliedFormat":1},{"version":"64db14db2bf37ac089766fdb3c7e1160fabc10e9929bc2deeede7237e4419fc8","impliedFormat":1},{"version":"98b94085c9f78eba36d3d2314affe973e8994f99864b8708122750788825c771","impliedFormat":1},{"version":"90ba95a763101bb61b8a799731a2ed60b5016b8135c1a2d5186862d4b534d4a1","impliedFormat":99},{"version":"072512b91dcc6cc612f51d5867eda45f34792a2a1a3f5300c2a368d41be40f4e","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3797fb7a7f36ebae5dc2f22c06476b03eb0b733ef51fa16918a14c1e69f18e44","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"}],"root":[80,83,133,134],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","useDefineForClassFields":true,"verbatimModuleSyntax":true},"referencedMap":[[114,1],[115,2],[122,3],[123,4],[93,5],[92,6],[116,5],[100,7],[102,8],[101,9],[109,10],[91,11],[85,12],[87,13],[89,14],[90,12],[129,15],[131,16],[130,17],[128,18],[96,19],[99,20],[97,19],[98,21],[118,22],[107,23],[103,24],[104,7],[125,25],[119,26],[105,27],[124,28],[106,29],[132,30],[126,31],[133,32],[134,33],[80,34],[83,35],[64,36],[66,37],[65,38],[75,39],[77,40],[70,40],[78,41],[79,42],[68,43],[67,44],[73,45],[72,46],[76,47],[82,48]],"latestChangedDtsFile":"./__tests__/reflect-uv-set-count.test.d.ts","version":"6.0.3"}
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/@webgpu+types@0.1.71/node_modules/@webgpu/types/dist/index.d.ts","../../types/dist/animation-target.d.ts","../../types/dist/asset-errors.d.ts","../../types/dist/result.d.ts","../../types/dist/asset-evidence.d.ts","../../types/dist/asset.d.ts","../../types/dist/material/color-space.d.ts","../../types/dist/material/asset.d.ts","../../types/dist/vfx.d.ts","../../types/dist/asset-runtime.d.ts","../../types/dist/handle.d.ts","../../types/dist/material/errors.d.ts","../../types/dist/material/resolve.d.ts","../../types/dist/material/index.d.ts","../../types/dist/asset-producer.d.ts","../../types/dist/catalog.d.ts","../../types/dist/runtime-scope.d.ts","../../types/dist/derive-paramschema.d.ts","../../types/dist/import.d.ts","../../types/dist/index.d.ts","../src/errors.ts","../../wgpu-wasm/pkg/wgpu_wasm.d.ts","../../wgpu-wasm/dist/index.d.ts","../src/index.ts","../../../node_modules/.pnpm/@vitest+pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/display.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/types.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/helpers.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/timers.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/index.d.ts","../../../node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/tasks.d-C7UxawJ9.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts","../../../node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/diff.d.ts","../../../node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/types.d.ts","../../../node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/traces.d.402V_yFI.d.ts","../../../node_modules/.pnpm/vite@7.3.6_@types+node@20.19.40_jiti@1.21.7_lightningcss@1.32.0/node_modules/vite/types/hmrPayload.d.ts","../../../node_modules/.pnpm/vite@7.3.6_@types+node@20.19.40_jiti@1.21.7_lightningcss@1.32.0/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts","../../../node_modules/.pnpm/vite@7.3.6_@types+node@20.19.40_jiti@1.21.7_lightningcss@1.32.0/node_modules/vite/types/customEvent.d.ts","../../../node_modules/.pnpm/vite@7.3.6_@types+node@20.19.40_jiti@1.21.7_lightningcss@1.32.0/node_modules/vite/types/hot.d.ts","../../../node_modules/.pnpm/vite@7.3.6_@types+node@20.19.40_jiti@1.21.7_lightningcss@1.32.0/node_modules/vite/dist/node/module-runner.d.ts","../../../node_modules/.pnpm/@vitest+snapshot@4.0.18/node_modules/@vitest/snapshot/dist/environment.d-DHdQ1Csl.d.ts","../../../node_modules/.pnpm/@vitest+snapshot@4.0.18/node_modules/@vitest/snapshot/dist/rawSnapshot.d-lFsMJFUd.d.ts","../../../node_modules/.pnpm/@vitest+snapshot@4.0.18/node_modules/@vitest/snapshot/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/config.d.Cy95HiCx.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/environment.d.CrsxCzP1.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/rpc.d.RH3apGEf.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/worker.d.Dyxm8DEL.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/browser.d.ChKACdzH.d.ts","../../../node_modules/.pnpm/@vitest+spy@4.0.18/node_modules/@vitest/spy/dist/index.d.ts","../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.d.ts","../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","../../../node_modules/.pnpm/assertion-error@2.0.1/node_modules/assertion-error/index.d.ts","../../../node_modules/.pnpm/@types+chai@5.2.3/node_modules/@types/chai/index.d.ts","../../../node_modules/.pnpm/@vitest+expect@4.0.18/node_modules/@vitest/expect/dist/index.d.ts","../../../node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/utils.d.ts","../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/benchmark.d.DAaHLpsq.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/global.d.B15mdLcR.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/suite.d.BJWk38HB.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.d.ts","../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.d.ts","../../../node_modules/.pnpm/vitest@4.0.18_@types+node@20.19.40_@vitest+browser-playwright@4.0.18_jiti@1.21.7_jsdom@26.1.0_lightningcss@1.32.0/node_modules/vitest/dist/index.d.ts","../src/__tests__/naga.unit.test.ts","../src/__tests__/reflect-uv-set-count.test.ts"],"fileIdsList":[[112,113],[85,89,92,94,109,110,111,114,119],[89,90,92,93],[89],[89,90,92],[89,90],[84,101,102],[84,101],[84,91],[84],[86],[84,85,86,87,88],[122,123],[122,123,124,125],[122,124],[122],[96],[96,97,98,99],[98],[94,116,117,119],[94,95,107,119],[84,92,94,103,119],[100],[84,94,103,106,115,118,119],[94,95,100,103,119],[94,116,117,118,119],[94,100,104,105,106,119],[84,89,92,94,95,100,103,104,105,106,107,108,109,115,116,117,118,119,120,121,126],[80,83,127],[83,127],[60,79],[80,82],[62,63,65],[62,63,65,79],[64],[63,65,74],[79],[62,74,75,76,79],[61,62,63,65,67,68,69,70,73,74,75,76,77,78],[66,79],[67],[66,67,71,72],[63,67,71],[74,75],[81]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2e5cfb2397ec8cacfd30de0e6f7992eb7db7b02cc83b7c43ef58bcd5aa88bc3","affectsGlobalScope":true,"impliedFormat":1},"89fe170d9a59f81cd9a9d95de3278f108ff91491810b2529cc0ffb502a57b6c0","0b4928041c807c01b33b1fa028236df635c52f7acff5a40f2c2d0d677b53428b","5ad2e5b8b17893d0eb1f11a1b6e8c03b17344be03a6a72a624cd38ab05fe4d5c","6a1e553079e654a1771463e9eeb98ea4f7bb4b6417a5237d4fdf9b546d49647f","7f11be86b9ac5c2cd5127cd9d40ccc7694c58868a3157692a153d452fc171525","6e3488ee1183ea915eb43f08aebc5f75e30be25aef1f678d1965324bdd7506e1","bc2f20caa6ccca429df0bf6a6f21506c4b00f9b171fdc3a4b6ada1775252db31","a318d8734523d9e750681e7b8e685ef817d4049c5612451f4e849da8b2b572a9","8b52dd8be86f44f871db89a6c1f77f7585688d53141ff55b6c5fac3eb67b1241","beae2d03867dde9fdf8da461c7e7e84da71612842422d4b482ab1c2a15fe6b12","080e7748d9754ccaea8debbc933552c7976c1ef588f9642a6f07e5a4d139d43b","51342c51a9090c0bc8bae60c5ec1a0f46d6d44db84392f12a8cd46e6d8a9f617","ae777307a0baeb9b5d7ba18e6a029a54eb0b612b1491591dcedb020cc8d36f97","d7ba738e316b7baed10ca49cc156b57b8c973b747bec6612e62a925e9f7f33a4","1d5292578fcf0329a43ef19fe2481d7d1cde75e75610019a7897c70dcfff0b31","459b3765e622008ed590474ae6b61ab55107a7b9529a28d05087a6fef51d7248","e1f11ad703121f97a74001059d054aba25c9c4662af44da05ead0a247fe18742","d9c64d02dfe3a9c74da35fdbcc645cf4e8d4ca0f4162ec312de51474103ac3a7","f4fbd89956010d9d27d3bbc562f0e5e00d374ba03a3f3bb11bcc94f5505bc3d2",{"version":"94a659763e9d9f96878c6ef8ab16dcf31bc724aaa26b0cad508cd456805a8891","signature":"61b18ed6e181badb438c38ca162ac8935b8d13d1c6f6e56f0f2f63e061e48b60"},"e1189f6ef446a71e336924e21ac773d8744006a5ec7f2bbecb5d275fbd907200","0347b27f786c1ee2e8478351dabcd31f7619dadf575983f7f3c37eeb63a01d8f",{"version":"50bf8cc10da602711d18145a1b58f6e56003def5cbb15237c02e9d5267709b1e","signature":"3df14e8404568cb1d6c5722faca2f4499e395fc20722b388a3375d35be68ea25"},{"version":"acfb723d81eda39156251aed414c553294870bf53062429ebfcfba8a68cb4753","impliedFormat":99},{"version":"fa69a90381c2f85889722a911a732a5ee3596dc3acecda8a9aa2fa89b9615d8d","impliedFormat":99},{"version":"b5ce343886d23392be9c8280e9f24a87f1d7d3667f6672c2fe4aa61fa4ece7d4","impliedFormat":99},{"version":"57e9e1b0911874c62d743af24b5d56032759846533641d550b12a45ff404bf07","impliedFormat":99},{"version":"b0857bb28fd5236ace84280f79a25093f919fd0eff13e47cc26ea03de60a7294","impliedFormat":99},{"version":"5e43e0824f10cd8c48e7a8c5c673638488925a12c31f0f9e0957965c290eb14c","impliedFormat":99},{"version":"854cd3a3375ffc4e7a92b2168dd065d7ff2614b43341038a65cca865a44c00c5","impliedFormat":99},{"version":"ef13c73d6157a32933c612d476c1524dd674cf5b9a88571d7d6a0d147544d529","impliedFormat":99},{"version":"3b0a56d056d81a011e484b9c05d5e430711aaecd561a788bad1d0498aad782c7","impliedFormat":99},{"version":"2f863ee9b873a65d9c3338ea7aaddbdb41a9673f062f06983d712bd01c25dc6b","impliedFormat":99},{"version":"67aa128c2bc170b93794f191feffc65a4b33e878db211cfcb7658c4b72f7a1f5","impliedFormat":99},{"version":"ac3d263474022e9a14c43f588f485d549641d839b159ecc971978b90f34bdf6b","impliedFormat":99},{"version":"a7ca8df4f2931bef2aa4118078584d84a0b16539598eaadf7dce9104dfaa381c","impliedFormat":1},{"version":"10073cdcf56982064c5337787cc59b79586131e1b28c106ede5bff362f912b70","impliedFormat":99},{"version":"72950913f4900b680f44d8cab6dd1ea0311698fc1eefb014eb9cdfc37ac4a734","impliedFormat":1},{"version":"36977c14a7f7bfc8c0426ae4343875689949fb699f3f84ecbe5b300ebf9a2c55","impliedFormat":1},{"version":"ff0a83c9a0489a627e264ffcb63f2264b935b20a502afa3a018848139e3d8575","impliedFormat":99},{"version":"324ac98294dab54fbd580c7d0e707d94506d7b2c3d5efe981a8495f02cf9ad96","impliedFormat":99},{"version":"9ec72eb493ff209b470467e24264116b6a8616484bca438091433a545dfba17e","impliedFormat":99},{"version":"c35b8117804c639c53c87f2c23e0c786df61d552e513bd5179f5b88e29964838","impliedFormat":99},{"version":"c609331c6ed4ad4af54e101088c6a4dcb48f8db7b0b97e44a6efeb130f4331bd","impliedFormat":99},{"version":"bcbd3becd08b4515225880abea0dbfbbf0d1181ce3af8f18f72f61edbe4febfb","impliedFormat":99},{"version":"67acaedb46832d66c15f1b09fb7b6a0b7f41bdbf8eaa586ec70459b3e8896eb9","impliedFormat":99},{"version":"4535ab977ee871e956eb7bebe2db5de79f5d5ec7dfbbf1d35e08f4a2d6630dac","impliedFormat":99},{"version":"b79b5ed99f26ffb2f8ae4bdcc4b34a9542197dc3fa96cfb425c2a81e618cff28","impliedFormat":99},{"version":"31fd7c12f6e27154efb52a916b872509a771880f3b20f2dfd045785c13aa813f","impliedFormat":99},{"version":"06db2f8ba1d1dfacf04529cb731081ab23f133f29c7608ebdfbcab356996827c","impliedFormat":99},{"version":"bdd14f07b4eca0b4b5203b85b8dbc4d084c749fa590bee5ea613e1641dcd3b29","impliedFormat":99},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"2eeffcee5c1661ddca53353929558037b8cf305ffb86a803512982f99bcab50d","impliedFormat":99},{"version":"9afb4cb864d297e4092a79ee2871b5d3143ea14153f62ef0bb04ede25f432030","affectsGlobalScope":true,"impliedFormat":99},{"version":"4e258d11c899cb9ff36b4b5c53df59cf4a5ccae9a9931529686e77431e0a3518","affectsGlobalScope":true,"impliedFormat":99},{"version":"a5ae67a67f786ffe92d34b55467a40fb50fb0093e92388cadce6168fa42690fd","impliedFormat":99},{"version":"69bf2422313487956e4dacf049f30cb91b34968912058d244cb19e4baa24da97","impliedFormat":99},{"version":"6987dfb4b0c4e02112cc4e548e7a77b3d9ddfeffa8c8a2db13ceac361a4567d9","impliedFormat":99},{"version":"a534e61c2f06a147d97aebad720db97dffd8066b7142212e46bcbcdcb640b81a","impliedFormat":99},{"version":"ddf569d04470a4d629090d43a16735185001f3fcf0ae036ead99f2ceab62be48","impliedFormat":99},{"version":"b413fbc6658fe2774f8bf9a15cf4c53e586fc38a2d5256b3b9647da242c14389","impliedFormat":99},{"version":"c30a41267fc04c6518b17e55dcb2b810f267af4314b0b6d7df1c33a76ce1b330","impliedFormat":1},{"version":"72422d0bac4076912385d0c10911b82e4694fc106e2d70added091f88f0824ba","impliedFormat":1},{"version":"da251b82c25bee1d93f9fd80c5a61d945da4f708ca21285541d7aff83ecb8200","impliedFormat":1},{"version":"64db14db2bf37ac089766fdb3c7e1160fabc10e9929bc2deeede7237e4419fc8","impliedFormat":1},{"version":"98b94085c9f78eba36d3d2314affe973e8994f99864b8708122750788825c771","impliedFormat":1},{"version":"53c448183c7177c83d3eb0b40824cf8952721a6584cf22052adc24f778986732","impliedFormat":99},{"version":"b3c607b5273a9016608513ae43ef7bbb828fd5c1759437c9c67bbaeae8c98272","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a00b7776e64fa36b40a9b8cd14d96679d8c2301b217dfccce9698e12a98cfb3a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"}],"root":[80,83,128,129],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","useDefineForClassFields":true,"verbatimModuleSyntax":true},"referencedMap":[[114,1],[115,2],[94,3],[90,4],[93,5],[116,6],[103,7],[102,8],[92,9],[85,10],[87,11],[89,12],[91,10],[124,13],[126,14],[125,15],[123,16],[97,17],[100,18],[98,17],[99,19],[118,20],[108,21],[104,22],[105,4],[121,23],[119,24],[106,25],[120,26],[107,27],[127,28],[128,29],[129,30],[80,31],[83,32],[64,33],[69,34],[65,35],[75,36],[77,37],[70,37],[78,38],[79,39],[67,40],[66,41],[73,42],[72,43],[76,44],[82,45]],"latestChangedDtsFile":"./__tests__/reflect-uv-set-count.test.d.ts","version":"6.0.3"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Result, type ShaderError } from './errors.js';
|
|
1
|
+
import { type Result, ShaderError, type ShaderError as ShaderErrorType } from './errors.js';
|
|
2
2
|
export { compileFailed, err, initFailed, manifestMalformed, ok, type Result, type ResultErr, type ResultOk, ShaderError, type ShaderErrorCode, type ShaderErrorDetail, shaderNotFound, } from './errors.js';
|
|
3
3
|
/**
|
|
4
4
|
* Handle for the `parse` output. The underlying type is a wasm-bindgen exported
|
|
@@ -16,24 +16,32 @@ export type ParsedModule = unknown;
|
|
|
16
16
|
* `emit_reflection` for the reflection JSON emit.
|
|
17
17
|
*/
|
|
18
18
|
export type ValidatedModule = unknown;
|
|
19
|
-
|
|
20
|
-
export interface RawMaterialMemberFact {
|
|
19
|
+
export interface ShaderReflectionMember {
|
|
21
20
|
readonly name: string;
|
|
22
21
|
readonly type: string;
|
|
23
22
|
readonly offset: number;
|
|
24
23
|
readonly size: number;
|
|
25
24
|
readonly alignment: number;
|
|
26
25
|
}
|
|
27
|
-
export interface
|
|
28
|
-
readonly
|
|
29
|
-
readonly kind: 'sampler' | 'texture' | 'storage-buffer';
|
|
26
|
+
export interface ShaderReflectionBoundGlobal {
|
|
27
|
+
readonly group: number;
|
|
30
28
|
readonly binding: number;
|
|
29
|
+
readonly addressSpace: string;
|
|
30
|
+
readonly resourceKind: string;
|
|
31
|
+
readonly visibility: number;
|
|
32
|
+
readonly name?: string;
|
|
33
|
+
readonly members?: readonly ShaderReflectionMember[];
|
|
34
|
+
readonly span?: number;
|
|
31
35
|
}
|
|
32
|
-
export interface
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
+
export interface ShaderReflection {
|
|
37
|
+
readonly schemaVersion: 'shader-reflection/2';
|
|
38
|
+
readonly boundGlobals: readonly ShaderReflectionBoundGlobal[];
|
|
39
|
+
readonly uvSetCount: number;
|
|
36
40
|
}
|
|
41
|
+
/** Parse and validate the business-neutral shader-reflection/2 wire. */
|
|
42
|
+
export declare function parseReflectionWire(json: string): ShaderReflection;
|
|
43
|
+
/** Result-form reader for callers that need an explicit unavailable/malformed branch. */
|
|
44
|
+
export declare function readReflectionWire(json: string | undefined): Result<ShaderReflection, ShaderErrorType>;
|
|
37
45
|
/**
|
|
38
46
|
* WGSL source -> `ParsedModule`.
|
|
39
47
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,MAAM,EACX,WAAW,EACX,KAAK,WAAW,IAAI,eAAe,EAEpC,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,EACb,GAAG,EACH,UAAU,EACV,iB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B,kBAAkB,CAChC,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,MAAM,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAe3C;AAID;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAkBtF;AAID;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,CAkB/C;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC,CAKjB;AAID;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,eAAe,EAC1B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAqBtC"}
|
package/dist/index.mjs
CHANGED
|
@@ -94,6 +94,123 @@ function wrapShaderError(e, hint) {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// src/index.ts
|
|
97
|
+
function reflectionMalformed(reason) {
|
|
98
|
+
return manifestMalformed({
|
|
99
|
+
message: `shader-reflection/2 is malformed: ${reason}`,
|
|
100
|
+
hint: "rebuild the shader with the current Naga/WASM producer and preserve every bound-global fact",
|
|
101
|
+
reason
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function isRecord(value) {
|
|
105
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
106
|
+
}
|
|
107
|
+
function requiredNonNegativeInteger(record, key) {
|
|
108
|
+
const value = record[key];
|
|
109
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {
|
|
110
|
+
throw reflectionMalformed(`boundGlobals entry requires non-negative integer '${key}'`);
|
|
111
|
+
}
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
function readMember(value, index) {
|
|
115
|
+
if (!isRecord(value)) throw reflectionMalformed(`member ${index} is not an object`);
|
|
116
|
+
const name = value.name;
|
|
117
|
+
const type = value.type;
|
|
118
|
+
if (typeof name !== "string" || name.length === 0 || typeof type !== "string" || type.length === 0) {
|
|
119
|
+
throw reflectionMalformed(`member ${index} requires name and type`);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
name,
|
|
123
|
+
type,
|
|
124
|
+
offset: requiredNonNegativeInteger(value, "offset"),
|
|
125
|
+
size: requiredNonNegativeInteger(value, "size"),
|
|
126
|
+
alignment: requiredNonNegativeInteger(value, "alignment")
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function readBoundGlobal(value, index) {
|
|
130
|
+
if (!isRecord(value)) throw reflectionMalformed(`boundGlobals entry ${index} is not an object`);
|
|
131
|
+
const addressSpace = value.addressSpace;
|
|
132
|
+
const resourceKind = value.resourceKind;
|
|
133
|
+
if (typeof addressSpace !== "string" || addressSpace.length === 0) {
|
|
134
|
+
throw reflectionMalformed(`boundGlobals entry ${index} requires addressSpace`);
|
|
135
|
+
}
|
|
136
|
+
if (typeof resourceKind !== "string" || resourceKind.length === 0) {
|
|
137
|
+
throw reflectionMalformed(`boundGlobals entry ${index} requires resourceKind`);
|
|
138
|
+
}
|
|
139
|
+
const visibility = requiredNonNegativeInteger(value, "visibility");
|
|
140
|
+
const membersValue = value.members;
|
|
141
|
+
const hasMembers = membersValue !== void 0;
|
|
142
|
+
if (hasMembers && !Array.isArray(membersValue)) {
|
|
143
|
+
throw reflectionMalformed(`boundGlobals entry ${index} members must be an array`);
|
|
144
|
+
}
|
|
145
|
+
const hasSpan = value.span !== void 0;
|
|
146
|
+
if (resourceKind === "buffer" || resourceKind === "storage-buffer") {
|
|
147
|
+
if (!hasMembers || !hasSpan) {
|
|
148
|
+
throw reflectionMalformed(`buffer boundGlobals entry ${index} requires members and span`);
|
|
149
|
+
}
|
|
150
|
+
} else if (hasMembers !== hasSpan) {
|
|
151
|
+
throw reflectionMalformed(`boundGlobals entry ${index} members and span must be paired`);
|
|
152
|
+
}
|
|
153
|
+
if (value.name !== void 0 && typeof value.name !== "string") {
|
|
154
|
+
throw reflectionMalformed(`boundGlobals entry ${index} diagnostic name must be a string`);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
group: requiredNonNegativeInteger(value, "group"),
|
|
158
|
+
binding: requiredNonNegativeInteger(value, "binding"),
|
|
159
|
+
addressSpace,
|
|
160
|
+
resourceKind,
|
|
161
|
+
visibility,
|
|
162
|
+
...value.name !== void 0 ? { name: value.name } : {},
|
|
163
|
+
...hasMembers ? {
|
|
164
|
+
members: membersValue.map(
|
|
165
|
+
(member, memberIndex) => readMember(member, memberIndex)
|
|
166
|
+
),
|
|
167
|
+
span: requiredNonNegativeInteger(value, "span")
|
|
168
|
+
} : {}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function parseReflectionWire(json) {
|
|
172
|
+
let parsed;
|
|
173
|
+
try {
|
|
174
|
+
parsed = JSON.parse(json);
|
|
175
|
+
} catch (cause) {
|
|
176
|
+
throw reflectionMalformed(cause instanceof Error ? cause.message : "JSON.parse failed");
|
|
177
|
+
}
|
|
178
|
+
if (!isRecord(parsed) || parsed.schemaVersion !== "shader-reflection/2") {
|
|
179
|
+
throw reflectionMalformed("schemaVersion must equal 'shader-reflection/2'");
|
|
180
|
+
}
|
|
181
|
+
if ("material" in parsed) throw reflectionMalformed("legacy material projection is not accepted");
|
|
182
|
+
if (!Array.isArray(parsed.boundGlobals)) {
|
|
183
|
+
throw reflectionMalformed("boundGlobals must be an array");
|
|
184
|
+
}
|
|
185
|
+
if (typeof parsed.uvSetCount !== "number" || !Number.isSafeInteger(parsed.uvSetCount) || parsed.uvSetCount < 0) {
|
|
186
|
+
throw reflectionMalformed("uvSetCount must be a non-negative integer");
|
|
187
|
+
}
|
|
188
|
+
const boundGlobals = parsed.boundGlobals.map((global, index) => readBoundGlobal(global, index));
|
|
189
|
+
const coordinates = /* @__PURE__ */ new Set();
|
|
190
|
+
for (const global of boundGlobals) {
|
|
191
|
+
const coordinate = `${global.group}:${global.binding}`;
|
|
192
|
+
if (coordinates.has(coordinate))
|
|
193
|
+
throw reflectionMalformed(`duplicate bound-global coordinate ${coordinate}`);
|
|
194
|
+
coordinates.add(coordinate);
|
|
195
|
+
}
|
|
196
|
+
return { schemaVersion: "shader-reflection/2", boundGlobals, uvSetCount: parsed.uvSetCount };
|
|
197
|
+
}
|
|
198
|
+
function readReflectionWire(json) {
|
|
199
|
+
if (json === void 0) {
|
|
200
|
+
return err(
|
|
201
|
+
initFailed({
|
|
202
|
+
message: "shader-reflection/2 is unavailable before the Naga producer emits a wire",
|
|
203
|
+
hint: "run the validated compose -> reflect path and retain its raw reflection bytes",
|
|
204
|
+
reason: "reflection wire unavailable"
|
|
205
|
+
})
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
try {
|
|
209
|
+
return ok(parseReflectionWire(json));
|
|
210
|
+
} catch (error) {
|
|
211
|
+
return err(error instanceof ShaderError ? error : reflectionMalformed(String(error)));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
97
214
|
async function parse(source) {
|
|
98
215
|
let wasm;
|
|
99
216
|
try {
|
|
@@ -160,6 +277,6 @@ async function emit_reflection(validated, options_json) {
|
|
|
160
277
|
}
|
|
161
278
|
}
|
|
162
279
|
|
|
163
|
-
export { ShaderError, compileFailed, composeShader, emit_reflection, initFailed, manifestMalformed, parse, shaderNotFound, validate };
|
|
280
|
+
export { ShaderError, compileFailed, composeShader, emit_reflection, initFailed, manifestMalformed, parse, parseReflectionWire, readReflectionWire, shaderNotFound, validate };
|
|
164
281
|
//# sourceMappingURL=index.mjs.map
|
|
165
282
|
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AAS,CAAA,EAAG;AACV,IAAA,OAAO,GAAA,CAAI,eAAA,CAAgB,CAAC,CAAC,CAAA;AAAA,EAC/B;AACF","file":"index.mjs","sourcesContent":["// @forgeax/engine-naga/errors — ShaderError + Result<T, E> + wrapShaderError helper.\n//\n// Form invariants (plan-strategy §D-P4 / requirements MVP-2.3 + AC-09):\n// - ShaderErrorCode (closed 4-member union) is imported from @forgeax/engine-types as\n// the SSOT. This package does **not** redefine the union — +0 breaking points\n// to the error model (AC-09; charter proposition 5 consistent abstraction).\n// - The ShaderError class shape + 4 factory helpers + Result<T, E> shape are\n// byte-for-byte equivalent to @forgeax/engine-shader-compiler/src/errors.ts; that\n// package will re-export from here in w7 after the import switch lands\n// (charter proposition 5 + plan-strategy D-P4 byte-for-byte form recovery).\n// - wrapShaderError is the JsError -> ShaderError adapter for the parse /\n// validate / emit_reflection wrappers in index.ts: it tries to JSON.parse the\n// wasm-side ParseErrorPayload (message / summary / line_num / line_pos)\n// first, falls back to the prose message for validator / reflection failures.\n\n/// <reference types=\"@webgpu/types\" />\n\nimport type { ShaderErrorCode, ShaderErrorDetail } from '@forgeax/engine-types';\n\nexport type { ShaderErrorCode, ShaderErrorDetail };\n\ninterface ShaderErrorInit {\n readonly code: ShaderErrorCode;\n readonly expected: string;\n readonly hint: string;\n readonly message: string;\n readonly lineNum?: number | undefined;\n readonly linePos?: number | undefined;\n readonly detail?: ShaderErrorDetail | undefined;\n}\n\n/**\n * Structured shader error.\n *\n * **5 surface fields** (MVP-2.3 top-level surface, AI consumer path):\n * - `.code` — member of the closed `ShaderErrorCode` union (4 variants)\n * - `.message` — display text (the base `Error` field, populated by the constructor)\n * - `.hint` — actionable recovery guidance (charter proposition 3: machine-readable hint over prose)\n * - `.lineNum` / `.linePos` — error source location (mandatory for compile-failed; undefined on other paths)\n *\n * **3 internal fields**:\n * - `.name` = `'ShaderError'` (debug tag)\n * - `.expected` — description of the expected state (symmetric with RhiError)\n * - `.detail` — path-specific extra info (e.g. all 6 fields of GPUCompilationMessage[])\n *\n * **Do not new directly** — construct via the 4 factories (compileFailed /\n * initFailed / manifestMalformed / shaderNotFound) to avoid ad-hoc arguments\n * bypassing union narrowing.\n */\nexport class ShaderError extends Error {\n override readonly name: 'ShaderError' = 'ShaderError';\n readonly code: ShaderErrorCode;\n readonly expected: string;\n readonly hint: string;\n readonly lineNum: number | undefined;\n readonly linePos: number | undefined;\n readonly detail: ShaderErrorDetail | undefined;\n\n constructor(init: ShaderErrorInit) {\n super(init.message);\n this.code = init.code;\n this.expected = init.expected;\n this.hint = init.hint;\n this.lineNum = init.lineNum;\n this.linePos = init.linePos;\n this.detail = init.detail;\n }\n}\n\n// === 4 factory helpers (plan-strategy §D-P4 closed union with 4 members) ===========\n\n/** `shader-compile-failed`: naga parse_str or Validator::validate failure. */\nexport function compileFailed(args: {\n readonly message: string;\n readonly hint: string;\n readonly lineNum?: number | undefined;\n readonly linePos?: number | undefined;\n readonly compilerMessages?: readonly GPUCompilationMessage[] | undefined;\n readonly reason?: string | undefined;\n}): ShaderError {\n return new ShaderError({\n code: 'shader-compile-failed',\n expected: 'WGSL source parses + validates against naga IR',\n message: args.message,\n hint: args.hint,\n ...(args.lineNum !== undefined ? { lineNum: args.lineNum } : {}),\n ...(args.linePos !== undefined ? { linePos: args.linePos } : {}),\n ...(args.compilerMessages !== undefined\n ? {\n detail: {\n code: 'shader-compile-failed',\n compilerMessages: args.compilerMessages,\n ...(args.reason !== undefined ? { reason: args.reason } : {}),\n },\n }\n : {}),\n });\n}\n\n/** `compiler-init-failed`: wasm loading or init() failure (cold start / missing wasm artifact). */\nexport function initFailed(args: {\n readonly message: string;\n readonly hint: string;\n readonly reason?: string | undefined;\n}): ShaderError {\n return new ShaderError({\n code: 'compiler-init-failed',\n expected: '@forgeax/engine-wgpu-wasm ensureReady() resolves with naga raw bindings available',\n message: args.message,\n hint: args.hint,\n detail: {\n code: 'compiler-init-failed',\n ...(args.reason !== undefined ? { reason: args.reason } : {}),\n },\n });\n}\n\n/** `manifest-malformed`: manifest.json schema validation failure (a required field is missing or JSON is not parseable). */\nexport function manifestMalformed(args: {\n readonly message: string;\n readonly hint: string;\n readonly reason?: string | undefined;\n}): ShaderError {\n return new ShaderError({\n code: 'manifest-malformed',\n expected: 'manifest.json parses + every entry has {hash, wgsl, glsl, bindings}',\n message: args.message,\n hint: args.hint,\n detail: {\n code: 'manifest-malformed',\n ...(args.reason !== undefined ? { reason: args.reason } : {}),\n },\n });\n}\n\n/** `shader-not-found`: ShaderRegistry.get(hash) hash miss. */\nexport function shaderNotFound(args: {\n readonly hash: string;\n readonly hint: string;\n}): ShaderError {\n return new ShaderError({\n code: 'shader-not-found',\n expected: `manifest.entries contains entry with hash '${args.hash}'`,\n message: `ShaderRegistry: hash '${args.hash}' not present in manifest`,\n hint: args.hint,\n });\n}\n\n// === wrapShaderError: JsError -> ShaderError adapter ================================\n\n/**\n * Translate a thrown wasm-bindgen JsError to a structured ShaderError.\n *\n * The Rust side serializes `ParseErrorPayload { message, summary, line_num,\n * line_pos }` to a JSON string and uses it as the JsError message. We attempt\n * JSON.parse first; on success the lineNum/linePos are extracted as top-level\n * surface fields (MVP-2.3). On failure (validator errors, reflection errors,\n * non-JSON messages) we fall back to the prose message — hint is always\n * populated so AI consumers always have an actionable recovery signal\n * (charter proposition 4 explicit failure + proposition 3 machine-readable hint).\n */\nexport function wrapShaderError(e: unknown, hint?: string): ShaderError {\n if (e instanceof Error) {\n try {\n const payload = JSON.parse(e.message) as {\n message?: string;\n summary?: string;\n line_num?: number | null;\n line_pos?: number | null;\n };\n return compileFailed({\n message: payload.summary ?? payload.message ?? e.message,\n hint:\n hint ??\n 'fix the WGSL source at the indicated line/column; see ShaderError.detail.compilerMessages for full diagnostic frame',\n ...(typeof payload.line_num === 'number' ? { lineNum: payload.line_num } : {}),\n ...(typeof payload.line_pos === 'number' ? { linePos: payload.line_pos } : {}),\n });\n } catch {\n return compileFailed({\n message: e.message,\n hint: hint ?? 'check WGSL syntax + validation rules; consult naga error output for details',\n });\n }\n }\n return compileFailed({\n message: String(e),\n hint:\n hint ??\n 'unknown error type from @forgeax/engine-wgpu-wasm; report as @forgeax/engine-naga bug',\n });\n}\n\n// === Result<T, E> ====================================================================\n//\n// Result<T, E> + ok / err + ResultOk / ResultErr live in `@forgeax/engine-types`\n// (tweak-20260612-result-into-types). They were duplicated here as a lite\n// (plain-object, no `unwrap`) variant; consolidated upstream into the same\n// shape used by rhi / ecs. The barrel here re-exports them so existing\n// `import { err, ok, Result, ResultOk, ResultErr } from '@forgeax/engine-naga'`\n// consumers stay unchanged.\nexport {\n err,\n ok,\n type Result,\n type ResultErr,\n type ResultOk,\n} from '@forgeax/engine-types';\n","// @forgeax/engine-naga — TS-only thin shell over @forgeax/engine-wgpu-wasm raw naga bindings.\n//\n// Form invariants (locked by plan-strategy D-P3 / D-P4 + research F-4):\n//\n// - snake_case three-phase functions byte-for-byte aligned with naga upstream\n// naming (this package replaces the legacy wasm-pack shim archived in\n// feat-20260511-naga-rhi-wgpu-merge M5 — charter proposition 2 industry\n// analogy + proposition 5 consistent abstraction).\n// - Each public function awaits ensureReady() from @forgeax/engine-wgpu-wasm before\n// calling the raw wasm-bindgen export — one wasm boundary crossing per page\n// lifecycle, shared with @forgeax/engine-rhi-wgpu (research F-4 ensureReady SSOT).\n// - Throws are caught at the wrapper boundary and translated to\n// Result.err(ShaderError) — never throw for expected failures\n// (AGENTS.md \"Errors are structured\" + charter proposition 4 explicit failure).\n// - The opaque handle types ParsedModule / ValidatedModule are re-exported\n// so downstream consumers (@forgeax/engine-shader-compiler) can hold the handle\n// between phases without inspecting the underlying naga IR\n// (plan-strategy §S-1 opaque handle invariant).\n\nimport { ensureReady } from '@forgeax/engine-wgpu-wasm';\nimport { err, ok, type Result, type ShaderError, wrapShaderError } from './errors.js';\n\nexport {\n compileFailed,\n err,\n initFailed,\n manifestMalformed,\n ok,\n type Result,\n type ResultErr,\n type ResultOk,\n ShaderError,\n type ShaderErrorCode,\n type ShaderErrorDetail,\n shaderNotFound,\n} from './errors.js';\n\n// === Opaque handle types ============================================================\n\n/**\n * Handle for the `parse` output. The underlying type is a wasm-bindgen exported\n * struct: JS can only hold the handle — it cannot inspect naga IR fields\n * directly (charter proposition 4 + opaque handle invariant). Pass through to\n * `validate` to advance to phase 2.\n *\n * Surface type uses `unknown` to keep this layer math-free and opaque-handle\n * pure (no direct dependency on @forgeax/engine-wgpu-wasm/pkg ABI types). Downstream\n * consumers should not inspect the handle.\n */\nexport type ParsedModule = unknown;\n\n/**\n * Handle for the `validate` output (Module + ModuleInfo); pass through to\n * `emit_reflection` for the reflection JSON emit.\n */\nexport type ValidatedModule = unknown;\n\n/** Structured material facts emitted by the independent raw Naga reflection. */\nexport interface RawMaterialMemberFact {\n readonly name: string;\n readonly type: string;\n readonly offset: number;\n readonly size: number;\n readonly alignment: number;\n}\n\nexport interface RawMaterialResourceFact {\n readonly name: string;\n readonly kind: 'sampler' | 'texture' | 'storage-buffer';\n readonly binding: number;\n}\n\nexport interface RawMaterialReflectionFacts {\n readonly members: readonly RawMaterialMemberFact[];\n readonly resources: readonly RawMaterialResourceFact[];\n readonly totalBytes: number;\n}\n\n// === Phase 1: parse =================================================================\n\n/**\n * WGSL source -> `ParsedModule`.\n *\n * On failure returns `Result.err(ShaderError code='shader-compile-failed')`\n * whose `lineNum` / `linePos` carry the source position (from the wasm-side\n * `ParseErrorPayload`). The hint defaults to actionable WGSL fix guidance.\n *\n * Wasm boundary: awaits ensureReady() on first call (shared singleton with\n * @forgeax/engine-rhi-wgpu); subsequent calls take the cached path.\n */\nexport async function parse(source: string): Promise<Result<ParsedModule, ShaderError>> {\n let wasm: Awaited<ReturnType<typeof ensureReady>>;\n try {\n wasm = await ensureReady();\n } catch (e) {\n return err(\n wrapShaderError(\n e,\n 'rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm',\n ),\n );\n }\n try {\n const parsed = wasm.parse(source);\n return ok(parsed as ParsedModule);\n } catch (e) {\n return err(wrapShaderError(e));\n }\n}\n\n// === Phase 2: validate ==============================================================\n\n/**\n * `ParsedModule` -> `ValidatedModule` (Module + ModuleInfo).\n *\n * **Ownership transfer** — wasm-bindgen consumes the `parsed` handle. Do not\n * reuse the handle after this call; passing a consumed handle is undefined\n * behaviour on the wasm side (research Finding 6 ownership semantics).\n *\n * On failure returns `Result.err(ShaderError code='shader-compile-failed')`.\n * Validator errors have no source position attached on the wasm side, so\n * `lineNum` / `linePos` remain undefined.\n */\nexport async function validate(\n parsed: ParsedModule,\n): Promise<Result<ValidatedModule, ShaderError>> {\n let wasm: Awaited<ReturnType<typeof ensureReady>>;\n try {\n wasm = await ensureReady();\n } catch (e) {\n return err(\n wrapShaderError(\n e,\n 'rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm',\n ),\n );\n }\n try {\n const validated = (wasm.validate as (p: unknown) => unknown)(parsed);\n return ok(validated as ValidatedModule);\n } catch (e) {\n return err(wrapShaderError(e));\n }\n}\n\n// === Composer passthrough ===========================================================\n\n/**\n * naga_oil Composer passthrough — `#import` + `#ifdef` composition over WGSL.\n *\n * Thin TS wrap over `@forgeax/engine-wgpu-wasm`'s raw `compose_shader` export\n * (feat-20260512 M1 compose.rs). Three-argument surface:\n *\n * - `entry` — the entry-point WGSL source (may contain `#import` directives\n * and `#ifdef` guards).\n * - `imports` — `moduleId -> wgslSource` map; each value is a companion\n * module whose header declares `#define_import_path <moduleId>` so the\n * upstream composer can register it. The map is JSON.stringified at the\n * wasm boundary.\n * - `defines` — `name -> boolean` map driving `#ifdef` branch elimination\n * (plan-strategy D-06: non-boolean values are rejected at the TS layer by\n * the shader-compiler wrapper; this wrap takes booleans verbatim). Also\n * JSON.stringified at the boundary.\n *\n * Return: the composed WGSL string (entry + inlined imports, `#ifdef` branches\n * resolved).\n *\n * Errors: the raw wasm export throws `JsError` whose message carries a\n * `shader-import-not-found: ...` or `shader-compile-failed: ...` prefix\n * (feat-20260512 M1 compose.rs convention). This wrap does **not** translate\n * the prefix into a structured `ShaderError`; that splitting happens one layer\n * up at `@forgeax/engine-shader-compiler` (feat-20260512 M3), which is where\n * the three-argument `compileShader(src, { imports, defines, id })` entry lives.\n * Callers of this raw passthrough should `try / catch` the thrown error.\n *\n * Wasm boundary: awaits `ensureReady()` on first call (shared singleton with\n * `@forgeax/engine-rhi-wgpu` + other naga phases); subsequent calls take the\n * cached path.\n */\nexport async function composeShader(\n entry: string,\n imports: Record<string, string>,\n defines: Record<string, boolean>,\n): Promise<string> {\n const wasm = await ensureReady();\n const compose = (wasm as { compose_shader: (e: string, i: string, d: string) => string })\n .compose_shader;\n return compose(entry, JSON.stringify(imports), JSON.stringify(defines));\n}\n\n// === Phase 3: emit_reflection =======================================================\n\n/**\n * `ValidatedModule` + options JSON -> `BindGroupLayoutDescriptor[]` JSON string.\n *\n * `options_json` shape: `{ \"dynamicOffsets\": [{ \"group\": u32, \"binding\": u32 }, ...] }`.\n * The naga IR does not express the dynamic-offset dimension (research Finding 2\n * footnote), so it is injected via this JS-side options string. Pass an empty\n * `{}` (or a JSON-encoded object without `dynamicOffsets`) for the no-dynamic-\n * offset path.\n *\n * The validator's borrowed reference is **not** consumed — the same\n * `ValidatedModule` handle can be reused for repeated emits with different\n * options (e.g. for variant generation).\n */\nexport async function emit_reflection(\n validated: ValidatedModule,\n options_json: string,\n): Promise<Result<string, ShaderError>> {\n let wasm: Awaited<ReturnType<typeof ensureReady>>;\n try {\n wasm = await ensureReady();\n } catch (e) {\n return err(\n wrapShaderError(\n e,\n 'rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm',\n ),\n );\n }\n try {\n const reflectionJson = (wasm.emit_reflection as (v: unknown, o: string) => string)(\n validated,\n options_json,\n );\n return ok(reflectionJson);\n } catch (e) {\n return err(wrapShaderError(e));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/index.ts"],"names":[],"mappings":";;;;;AAiDO,I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AC3B,SAAS,CAAA,EAAG;AACV,IAAA,OAAO,GAAA;AAAA,MACL,eAAA;AAAA,QACE,CAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,EACF;AACA,EAAA,IAAI;AACF,IAAA,MAAM,iBAAkB,IAAA,CAAK,eAAA;AAAA,MAC3B,SAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,OAAO,GAAG,cAAc,CAAA;AAAA,EAC1B,SAAS,CAAA,EAAG;AACV,IAAA,OAAO,GAAA,CAAI,eAAA,CAAgB,CAAC,CAAC,CAAA;AAAA,EAC/B;AACF","file":"index.mjs","sourcesContent":["// @forgeax/engine-naga/errors — ShaderError + Result<T, E> + wrapShaderError helper.\n//\n// Form invariants (plan-strategy §D-P4 / requirements MVP-2.3 + AC-09):\n// - ShaderErrorCode (closed 4-member union) is imported from @forgeax/engine-types as\n// the SSOT. This package does **not** redefine the union — +0 breaking points\n// to the error model (AC-09; charter proposition 5 consistent abstraction).\n// - The ShaderError class shape + 4 factory helpers + Result<T, E> shape are\n// byte-for-byte equivalent to @forgeax/engine-shader-compiler/src/errors.ts; that\n// package will re-export from here in w7 after the import switch lands\n// (charter proposition 5 + plan-strategy D-P4 byte-for-byte form recovery).\n// - wrapShaderError is the JsError -> ShaderError adapter for the parse /\n// validate / emit_reflection wrappers in index.ts: it tries to JSON.parse the\n// wasm-side ParseErrorPayload (message / summary / line_num / line_pos)\n// first, falls back to the prose message for validator / reflection failures.\n\n/// <reference types=\"@webgpu/types\" />\n\nimport type { ShaderErrorCode, ShaderErrorDetail } from '@forgeax/engine-types';\n\nexport type { ShaderErrorCode, ShaderErrorDetail };\n\ninterface ShaderErrorInit {\n readonly code: ShaderErrorCode;\n readonly expected: string;\n readonly hint: string;\n readonly message: string;\n readonly lineNum?: number | undefined;\n readonly linePos?: number | undefined;\n readonly detail?: ShaderErrorDetail | undefined;\n}\n\n/**\n * Structured shader error.\n *\n * **5 surface fields** (MVP-2.3 top-level surface, AI consumer path):\n * - `.code` — member of the closed `ShaderErrorCode` union (4 variants)\n * - `.message` — display text (the base `Error` field, populated by the constructor)\n * - `.hint` — actionable recovery guidance (charter proposition 3: machine-readable hint over prose)\n * - `.lineNum` / `.linePos` — error source location (mandatory for compile-failed; undefined on other paths)\n *\n * **3 internal fields**:\n * - `.name` = `'ShaderError'` (debug tag)\n * - `.expected` — description of the expected state (symmetric with RhiError)\n * - `.detail` — path-specific extra info (e.g. all 6 fields of GPUCompilationMessage[])\n *\n * **Do not new directly** — construct via the 4 factories (compileFailed /\n * initFailed / manifestMalformed / shaderNotFound) to avoid ad-hoc arguments\n * bypassing union narrowing.\n */\nexport class ShaderError extends Error {\n override readonly name: 'ShaderError' = 'ShaderError';\n readonly code: ShaderErrorCode;\n readonly expected: string;\n readonly hint: string;\n readonly lineNum: number | undefined;\n readonly linePos: number | undefined;\n readonly detail: ShaderErrorDetail | undefined;\n\n constructor(init: ShaderErrorInit) {\n super(init.message);\n this.code = init.code;\n this.expected = init.expected;\n this.hint = init.hint;\n this.lineNum = init.lineNum;\n this.linePos = init.linePos;\n this.detail = init.detail;\n }\n}\n\n// === 4 factory helpers (plan-strategy §D-P4 closed union with 4 members) ===========\n\n/** `shader-compile-failed`: naga parse_str or Validator::validate failure. */\nexport function compileFailed(args: {\n readonly message: string;\n readonly hint: string;\n readonly lineNum?: number | undefined;\n readonly linePos?: number | undefined;\n readonly compilerMessages?: readonly GPUCompilationMessage[] | undefined;\n readonly reason?: string | undefined;\n}): ShaderError {\n return new ShaderError({\n code: 'shader-compile-failed',\n expected: 'WGSL source parses + validates against naga IR',\n message: args.message,\n hint: args.hint,\n ...(args.lineNum !== undefined ? { lineNum: args.lineNum } : {}),\n ...(args.linePos !== undefined ? { linePos: args.linePos } : {}),\n ...(args.compilerMessages !== undefined\n ? {\n detail: {\n code: 'shader-compile-failed',\n compilerMessages: args.compilerMessages,\n ...(args.reason !== undefined ? { reason: args.reason } : {}),\n },\n }\n : {}),\n });\n}\n\n/** `compiler-init-failed`: wasm loading or init() failure (cold start / missing wasm artifact). */\nexport function initFailed(args: {\n readonly message: string;\n readonly hint: string;\n readonly reason?: string | undefined;\n}): ShaderError {\n return new ShaderError({\n code: 'compiler-init-failed',\n expected: '@forgeax/engine-wgpu-wasm ensureReady() resolves with naga raw bindings available',\n message: args.message,\n hint: args.hint,\n detail: {\n code: 'compiler-init-failed',\n ...(args.reason !== undefined ? { reason: args.reason } : {}),\n },\n });\n}\n\n/** `manifest-malformed`: manifest.json schema validation failure (a required field is missing or JSON is not parseable). */\nexport function manifestMalformed(args: {\n readonly message: string;\n readonly hint: string;\n readonly reason?: string | undefined;\n}): ShaderError {\n return new ShaderError({\n code: 'manifest-malformed',\n expected: 'manifest.json parses + every entry has {hash, wgsl, glsl, bindings}',\n message: args.message,\n hint: args.hint,\n detail: {\n code: 'manifest-malformed',\n ...(args.reason !== undefined ? { reason: args.reason } : {}),\n },\n });\n}\n\n/** `shader-not-found`: ShaderRegistry.get(hash) hash miss. */\nexport function shaderNotFound(args: {\n readonly hash: string;\n readonly hint: string;\n}): ShaderError {\n return new ShaderError({\n code: 'shader-not-found',\n expected: `manifest.entries contains entry with hash '${args.hash}'`,\n message: `ShaderRegistry: hash '${args.hash}' not present in manifest`,\n hint: args.hint,\n });\n}\n\n// === wrapShaderError: JsError -> ShaderError adapter ================================\n\n/**\n * Translate a thrown wasm-bindgen JsError to a structured ShaderError.\n *\n * The Rust side serializes `ParseErrorPayload { message, summary, line_num,\n * line_pos }` to a JSON string and uses it as the JsError message. We attempt\n * JSON.parse first; on success the lineNum/linePos are extracted as top-level\n * surface fields (MVP-2.3). On failure (validator errors, reflection errors,\n * non-JSON messages) we fall back to the prose message — hint is always\n * populated so AI consumers always have an actionable recovery signal\n * (charter proposition 4 explicit failure + proposition 3 machine-readable hint).\n */\nexport function wrapShaderError(e: unknown, hint?: string): ShaderError {\n if (e instanceof Error) {\n try {\n const payload = JSON.parse(e.message) as {\n message?: string;\n summary?: string;\n line_num?: number | null;\n line_pos?: number | null;\n };\n return compileFailed({\n message: payload.summary ?? payload.message ?? e.message,\n hint:\n hint ??\n 'fix the WGSL source at the indicated line/column; see ShaderError.detail.compilerMessages for full diagnostic frame',\n ...(typeof payload.line_num === 'number' ? { lineNum: payload.line_num } : {}),\n ...(typeof payload.line_pos === 'number' ? { linePos: payload.line_pos } : {}),\n });\n } catch {\n return compileFailed({\n message: e.message,\n hint: hint ?? 'check WGSL syntax + validation rules; consult naga error output for details',\n });\n }\n }\n return compileFailed({\n message: String(e),\n hint:\n hint ??\n 'unknown error type from @forgeax/engine-wgpu-wasm; report as @forgeax/engine-naga bug',\n });\n}\n\n// === Result<T, E> ====================================================================\n//\n// Result<T, E> + ok / err + ResultOk / ResultErr live in `@forgeax/engine-types`\n// (tweak-20260612-result-into-types). They were duplicated here as a lite\n// (plain-object, no `unwrap`) variant; consolidated upstream into the same\n// shape used by rhi / ecs. The barrel here re-exports them so existing\n// `import { err, ok, Result, ResultOk, ResultErr } from '@forgeax/engine-naga'`\n// consumers stay unchanged.\nexport {\n err,\n ok,\n type Result,\n type ResultErr,\n type ResultOk,\n} from '@forgeax/engine-types';\n","// @forgeax/engine-naga — TS-only thin shell over @forgeax/engine-wgpu-wasm raw naga bindings.\n//\n// Form invariants (locked by plan-strategy D-P3 / D-P4 + research F-4):\n//\n// - snake_case three-phase functions byte-for-byte aligned with naga upstream\n// naming (this package replaces the legacy wasm-pack shim archived in\n// feat-20260511-naga-rhi-wgpu-merge M5 — charter proposition 2 industry\n// analogy + proposition 5 consistent abstraction).\n// - Each public function awaits ensureReady() from @forgeax/engine-wgpu-wasm before\n// calling the raw wasm-bindgen export — one wasm boundary crossing per page\n// lifecycle, shared with @forgeax/engine-rhi-wgpu (research F-4 ensureReady SSOT).\n// - Throws are caught at the wrapper boundary and translated to\n// Result.err(ShaderError) — never throw for expected failures\n// (AGENTS.md \"Errors are structured\" + charter proposition 4 explicit failure).\n// - The opaque handle types ParsedModule / ValidatedModule are re-exported\n// so downstream consumers (@forgeax/engine-shader-compiler) can hold the handle\n// between phases without inspecting the underlying naga IR\n// (plan-strategy §S-1 opaque handle invariant).\n\nimport { ensureReady } from '@forgeax/engine-wgpu-wasm';\nimport {\n err,\n initFailed,\n manifestMalformed,\n ok,\n type Result,\n ShaderError,\n type ShaderError as ShaderErrorType,\n wrapShaderError,\n} from './errors.js';\n\nexport {\n compileFailed,\n err,\n initFailed,\n manifestMalformed,\n ok,\n type Result,\n type ResultErr,\n type ResultOk,\n ShaderError,\n type ShaderErrorCode,\n type ShaderErrorDetail,\n shaderNotFound,\n} from './errors.js';\n\n// === Opaque handle types ============================================================\n\n/**\n * Handle for the `parse` output. The underlying type is a wasm-bindgen exported\n * struct: JS can only hold the handle — it cannot inspect naga IR fields\n * directly (charter proposition 4 + opaque handle invariant). Pass through to\n * `validate` to advance to phase 2.\n *\n * Surface type uses `unknown` to keep this layer math-free and opaque-handle\n * pure (no direct dependency on @forgeax/engine-wgpu-wasm/pkg ABI types). Downstream\n * consumers should not inspect the handle.\n */\nexport type ParsedModule = unknown;\n\n/**\n * Handle for the `validate` output (Module + ModuleInfo); pass through to\n * `emit_reflection` for the reflection JSON emit.\n */\nexport type ValidatedModule = unknown;\n\nexport interface ShaderReflectionMember {\n readonly name: string;\n readonly type: string;\n readonly offset: number;\n readonly size: number;\n readonly alignment: number;\n}\n\nexport interface ShaderReflectionBoundGlobal {\n readonly group: number;\n readonly binding: number;\n readonly addressSpace: string;\n readonly resourceKind: string;\n readonly visibility: number;\n readonly name?: string;\n readonly members?: readonly ShaderReflectionMember[];\n readonly span?: number;\n}\n\nexport interface ShaderReflection {\n readonly schemaVersion: 'shader-reflection/2';\n readonly boundGlobals: readonly ShaderReflectionBoundGlobal[];\n readonly uvSetCount: number;\n}\n\ntype ReflectionRecord = Record<string, unknown>;\n\nfunction reflectionMalformed(reason: string): ShaderError {\n return manifestMalformed({\n message: `shader-reflection/2 is malformed: ${reason}`,\n hint: 'rebuild the shader with the current Naga/WASM producer and preserve every bound-global fact',\n reason,\n });\n}\n\nfunction isRecord(value: unknown): value is ReflectionRecord {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction requiredNonNegativeInteger(record: ReflectionRecord, key: string): number {\n const value = record[key];\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0) {\n throw reflectionMalformed(`boundGlobals entry requires non-negative integer '${key}'`);\n }\n return value;\n}\n\nfunction readMember(value: unknown, index: number): ShaderReflectionMember {\n if (!isRecord(value)) throw reflectionMalformed(`member ${index} is not an object`);\n const name = value.name;\n const type = value.type;\n if (\n typeof name !== 'string' ||\n name.length === 0 ||\n typeof type !== 'string' ||\n type.length === 0\n ) {\n throw reflectionMalformed(`member ${index} requires name and type`);\n }\n return {\n name,\n type,\n offset: requiredNonNegativeInteger(value, 'offset'),\n size: requiredNonNegativeInteger(value, 'size'),\n alignment: requiredNonNegativeInteger(value, 'alignment'),\n };\n}\n\nfunction readBoundGlobal(value: unknown, index: number): ShaderReflectionBoundGlobal {\n if (!isRecord(value)) throw reflectionMalformed(`boundGlobals entry ${index} is not an object`);\n const addressSpace = value.addressSpace;\n const resourceKind = value.resourceKind;\n if (typeof addressSpace !== 'string' || addressSpace.length === 0) {\n throw reflectionMalformed(`boundGlobals entry ${index} requires addressSpace`);\n }\n if (typeof resourceKind !== 'string' || resourceKind.length === 0) {\n throw reflectionMalformed(`boundGlobals entry ${index} requires resourceKind`);\n }\n const visibility = requiredNonNegativeInteger(value, 'visibility');\n const membersValue = value.members;\n const hasMembers = membersValue !== undefined;\n if (hasMembers && !Array.isArray(membersValue)) {\n throw reflectionMalformed(`boundGlobals entry ${index} members must be an array`);\n }\n const hasSpan = value.span !== undefined;\n if (resourceKind === 'buffer' || resourceKind === 'storage-buffer') {\n if (!hasMembers || !hasSpan) {\n throw reflectionMalformed(`buffer boundGlobals entry ${index} requires members and span`);\n }\n } else if (hasMembers !== hasSpan) {\n throw reflectionMalformed(`boundGlobals entry ${index} members and span must be paired`);\n }\n if (value.name !== undefined && typeof value.name !== 'string') {\n throw reflectionMalformed(`boundGlobals entry ${index} diagnostic name must be a string`);\n }\n return {\n group: requiredNonNegativeInteger(value, 'group'),\n binding: requiredNonNegativeInteger(value, 'binding'),\n addressSpace,\n resourceKind,\n visibility,\n ...(value.name !== undefined ? { name: value.name as string } : {}),\n ...(hasMembers\n ? {\n members: (membersValue as unknown[]).map((member, memberIndex) =>\n readMember(member, memberIndex),\n ),\n span: requiredNonNegativeInteger(value, 'span'),\n }\n : {}),\n };\n}\n\n/** Parse and validate the business-neutral shader-reflection/2 wire. */\nexport function parseReflectionWire(json: string): ShaderReflection {\n let parsed: unknown;\n try {\n parsed = JSON.parse(json);\n } catch (cause) {\n throw reflectionMalformed(cause instanceof Error ? cause.message : 'JSON.parse failed');\n }\n if (!isRecord(parsed) || parsed.schemaVersion !== 'shader-reflection/2') {\n throw reflectionMalformed(\"schemaVersion must equal 'shader-reflection/2'\");\n }\n if ('material' in parsed) throw reflectionMalformed('legacy material projection is not accepted');\n if (!Array.isArray(parsed.boundGlobals)) {\n throw reflectionMalformed('boundGlobals must be an array');\n }\n if (\n typeof parsed.uvSetCount !== 'number' ||\n !Number.isSafeInteger(parsed.uvSetCount) ||\n parsed.uvSetCount < 0\n ) {\n throw reflectionMalformed('uvSetCount must be a non-negative integer');\n }\n const boundGlobals = parsed.boundGlobals.map((global, index) => readBoundGlobal(global, index));\n const coordinates = new Set<string>();\n for (const global of boundGlobals) {\n const coordinate = `${global.group}:${global.binding}`;\n if (coordinates.has(coordinate))\n throw reflectionMalformed(`duplicate bound-global coordinate ${coordinate}`);\n coordinates.add(coordinate);\n }\n return { schemaVersion: 'shader-reflection/2', boundGlobals, uvSetCount: parsed.uvSetCount };\n}\n\n/** Result-form reader for callers that need an explicit unavailable/malformed branch. */\nexport function readReflectionWire(\n json: string | undefined,\n): Result<ShaderReflection, ShaderErrorType> {\n if (json === undefined) {\n return err(\n initFailed({\n message: 'shader-reflection/2 is unavailable before the Naga producer emits a wire',\n hint: 'run the validated compose -> reflect path and retain its raw reflection bytes',\n reason: 'reflection wire unavailable',\n }),\n );\n }\n try {\n return ok(parseReflectionWire(json));\n } catch (error) {\n return err(error instanceof ShaderError ? error : reflectionMalformed(String(error)));\n }\n}\n\n// === Phase 1: parse =================================================================\n\n/**\n * WGSL source -> `ParsedModule`.\n *\n * On failure returns `Result.err(ShaderError code='shader-compile-failed')`\n * whose `lineNum` / `linePos` carry the source position (from the wasm-side\n * `ParseErrorPayload`). The hint defaults to actionable WGSL fix guidance.\n *\n * Wasm boundary: awaits ensureReady() on first call (shared singleton with\n * @forgeax/engine-rhi-wgpu); subsequent calls take the cached path.\n */\nexport async function parse(source: string): Promise<Result<ParsedModule, ShaderError>> {\n let wasm: Awaited<ReturnType<typeof ensureReady>>;\n try {\n wasm = await ensureReady();\n } catch (e) {\n return err(\n wrapShaderError(\n e,\n 'rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm',\n ),\n );\n }\n try {\n const parsed = wasm.parse(source);\n return ok(parsed as ParsedModule);\n } catch (e) {\n return err(wrapShaderError(e));\n }\n}\n\n// === Phase 2: validate ==============================================================\n\n/**\n * `ParsedModule` -> `ValidatedModule` (Module + ModuleInfo).\n *\n * **Ownership transfer** — wasm-bindgen consumes the `parsed` handle. Do not\n * reuse the handle after this call; passing a consumed handle is undefined\n * behaviour on the wasm side (research Finding 6 ownership semantics).\n *\n * On failure returns `Result.err(ShaderError code='shader-compile-failed')`.\n * Validator errors have no source position attached on the wasm side, so\n * `lineNum` / `linePos` remain undefined.\n */\nexport async function validate(\n parsed: ParsedModule,\n): Promise<Result<ValidatedModule, ShaderError>> {\n let wasm: Awaited<ReturnType<typeof ensureReady>>;\n try {\n wasm = await ensureReady();\n } catch (e) {\n return err(\n wrapShaderError(\n e,\n 'rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm',\n ),\n );\n }\n try {\n const validated = (wasm.validate as (p: unknown) => unknown)(parsed);\n return ok(validated as ValidatedModule);\n } catch (e) {\n return err(wrapShaderError(e));\n }\n}\n\n// === Composer passthrough ===========================================================\n\n/**\n * naga_oil Composer passthrough — `#import` + `#ifdef` composition over WGSL.\n *\n * Thin TS wrap over `@forgeax/engine-wgpu-wasm`'s raw `compose_shader` export\n * (feat-20260512 M1 compose.rs). Three-argument surface:\n *\n * - `entry` — the entry-point WGSL source (may contain `#import` directives\n * and `#ifdef` guards).\n * - `imports` — `moduleId -> wgslSource` map; each value is a companion\n * module whose header declares `#define_import_path <moduleId>` so the\n * upstream composer can register it. The map is JSON.stringified at the\n * wasm boundary.\n * - `defines` — `name -> boolean` map driving `#ifdef` branch elimination\n * (plan-strategy D-06: non-boolean values are rejected at the TS layer by\n * the shader-compiler wrapper; this wrap takes booleans verbatim). Also\n * JSON.stringified at the boundary.\n *\n * Return: the composed WGSL string (entry + inlined imports, `#ifdef` branches\n * resolved).\n *\n * Errors: the raw wasm export throws `JsError` whose message carries a\n * `shader-import-not-found: ...` or `shader-compile-failed: ...` prefix\n * (feat-20260512 M1 compose.rs convention). This wrap does **not** translate\n * the prefix into a structured `ShaderError`; that splitting happens one layer\n * up at `@forgeax/engine-shader-compiler` (feat-20260512 M3), which is where\n * the three-argument `compileShader(src, { imports, defines, id })` entry lives.\n * Callers of this raw passthrough should `try / catch` the thrown error.\n *\n * Wasm boundary: awaits `ensureReady()` on first call (shared singleton with\n * `@forgeax/engine-rhi-wgpu` + other naga phases); subsequent calls take the\n * cached path.\n */\nexport async function composeShader(\n entry: string,\n imports: Record<string, string>,\n defines: Record<string, boolean>,\n): Promise<string> {\n const wasm = await ensureReady();\n const compose = (wasm as { compose_shader: (e: string, i: string, d: string) => string })\n .compose_shader;\n return compose(entry, JSON.stringify(imports), JSON.stringify(defines));\n}\n\n// === Phase 3: emit_reflection =======================================================\n\n/**\n * `ValidatedModule` + options JSON -> `BindGroupLayoutDescriptor[]` JSON string.\n *\n * `options_json` shape: `{ \"dynamicOffsets\": [{ \"group\": u32, \"binding\": u32 }, ...] }`.\n * The naga IR does not express the dynamic-offset dimension (research Finding 2\n * footnote), so it is injected via this JS-side options string. Pass an empty\n * `{}` (or a JSON-encoded object without `dynamicOffsets`) for the no-dynamic-\n * offset path.\n *\n * The validator's borrowed reference is **not** consumed — the same\n * `ValidatedModule` handle can be reused for repeated emits with different\n * options (e.g. for variant generation).\n */\nexport async function emit_reflection(\n validated: ValidatedModule,\n options_json: string,\n): Promise<Result<string, ShaderError>> {\n let wasm: Awaited<ReturnType<typeof ensureReady>>;\n try {\n wasm = await ensureReady();\n } catch (e) {\n return err(\n wrapShaderError(\n e,\n 'rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm',\n ),\n );\n }\n try {\n const reflectionJson = (wasm.emit_reflection as (v: unknown, o: string) => string)(\n validated,\n options_json,\n );\n return ok(reflectionJson);\n } catch (e) {\n return err(wrapShaderError(e));\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgeax/engine-naga",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"LICENSE"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@forgeax/engine-types": "0.1.
|
|
26
|
-
"@forgeax/engine-wgpu-wasm": "0.1.
|
|
25
|
+
"@forgeax/engine-types": "0.1.7",
|
|
26
|
+
"@forgeax/engine-wgpu-wasm": "0.1.7",
|
|
27
27
|
"@webgpu/types": "^0.1.71"
|
|
28
28
|
},
|
|
29
29
|
"forgeax": {
|
|
@@ -113,6 +113,134 @@ vi.mock('@forgeax/engine-wgpu-wasm', () => ({
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
{
|
|
117
|
+
// M3 characterization: the raw Naga reader must consume only the generic
|
|
118
|
+
// shader-reflection/2 wire. Material meaning is selected by shader-compiler.
|
|
119
|
+
describe('shader-reflection/2 generic bound-global wire', () => {
|
|
120
|
+
const uniform = {
|
|
121
|
+
group: 1,
|
|
122
|
+
binding: 0,
|
|
123
|
+
addressSpace: 'uniform',
|
|
124
|
+
resourceKind: 'buffer',
|
|
125
|
+
visibility: 3,
|
|
126
|
+
name: 'surfaceParameters',
|
|
127
|
+
members: [
|
|
128
|
+
{
|
|
129
|
+
name: 'roughness',
|
|
130
|
+
type: 'f32',
|
|
131
|
+
offset: 0,
|
|
132
|
+
size: 4,
|
|
133
|
+
alignment: 4,
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
span: 16,
|
|
137
|
+
};
|
|
138
|
+
const texture = {
|
|
139
|
+
group: 1,
|
|
140
|
+
binding: 3,
|
|
141
|
+
addressSpace: 'handle',
|
|
142
|
+
resourceKind: 'texture',
|
|
143
|
+
visibility: 2,
|
|
144
|
+
name: 'albedoTexture',
|
|
145
|
+
};
|
|
146
|
+
const generic = {
|
|
147
|
+
schemaVersion: 'shader-reflection/2',
|
|
148
|
+
boundGlobals: [uniform, texture],
|
|
149
|
+
uvSetCount: 0,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
it('keeps complete coordinates, member span, visibility, kind, and diagnostic name', async () => {
|
|
153
|
+
const { parseReflectionWire } = await import('../index.js');
|
|
154
|
+
expect(parseReflectionWire(JSON.stringify(generic))).toEqual(generic);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('does not use the global name as identity when a shader renames it', async () => {
|
|
158
|
+
const { parseReflectionWire } = await import('../index.js');
|
|
159
|
+
const renamed = {
|
|
160
|
+
...generic,
|
|
161
|
+
boundGlobals: [{ ...uniform, name: 'renamedSurfaceBlock' }, texture],
|
|
162
|
+
};
|
|
163
|
+
expect(parseReflectionWire(JSON.stringify(renamed)).boundGlobals[0]).toMatchObject({
|
|
164
|
+
group: 1,
|
|
165
|
+
binding: 0,
|
|
166
|
+
addressSpace: 'uniform',
|
|
167
|
+
resourceKind: 'buffer',
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('retains unrelated groups, collisions, and binding gaps as raw facts', async () => {
|
|
172
|
+
const { parseReflectionWire } = await import('../index.js');
|
|
173
|
+
const withFacts = {
|
|
174
|
+
...generic,
|
|
175
|
+
boundGlobals: [
|
|
176
|
+
{ ...uniform, group: 0, binding: 0, name: 'engineView' },
|
|
177
|
+
{ ...uniform, group: 1, binding: 0, name: 'collision' },
|
|
178
|
+
{ ...texture, binding: 7 },
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
expect(parseReflectionWire(JSON.stringify(withFacts)).boundGlobals).toHaveLength(3);
|
|
182
|
+
expect(parseReflectionWire(JSON.stringify(withFacts)).boundGlobals[2]).toMatchObject({
|
|
183
|
+
group: 1,
|
|
184
|
+
binding: 7,
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('accepts explicit empty and static-only reflection without a material fallback', async () => {
|
|
189
|
+
const { parseReflectionWire } = await import('../index.js');
|
|
190
|
+
expect(
|
|
191
|
+
parseReflectionWire(
|
|
192
|
+
JSON.stringify({ schemaVersion: 'shader-reflection/2', boundGlobals: [], uvSetCount: 0 }),
|
|
193
|
+
),
|
|
194
|
+
).toMatchObject({ boundGlobals: [] });
|
|
195
|
+
expect(
|
|
196
|
+
parseReflectionWire(
|
|
197
|
+
JSON.stringify({
|
|
198
|
+
schemaVersion: 'shader-reflection/2',
|
|
199
|
+
boundGlobals: [texture],
|
|
200
|
+
uvSetCount: 0,
|
|
201
|
+
}),
|
|
202
|
+
).boundGlobals,
|
|
203
|
+
).toHaveLength(1);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it.each([
|
|
207
|
+
['old array wire', []],
|
|
208
|
+
['missing schema version', { boundGlobals: [uniform], uvSetCount: 0 }],
|
|
209
|
+
['missing group', { ...generic, boundGlobals: [{ ...uniform, group: undefined }] }],
|
|
210
|
+
['missing binding', { ...generic, boundGlobals: [{ ...uniform, binding: undefined }] }],
|
|
211
|
+
[
|
|
212
|
+
'missing address space',
|
|
213
|
+
{ ...generic, boundGlobals: [{ ...uniform, addressSpace: undefined }] },
|
|
214
|
+
],
|
|
215
|
+
[
|
|
216
|
+
'missing resource kind',
|
|
217
|
+
{ ...generic, boundGlobals: [{ ...uniform, resourceKind: undefined }] },
|
|
218
|
+
],
|
|
219
|
+
[
|
|
220
|
+
'missing uniform members',
|
|
221
|
+
{ ...generic, boundGlobals: [{ ...uniform, members: undefined }] },
|
|
222
|
+
],
|
|
223
|
+
['missing uniform span', { ...generic, boundGlobals: [{ ...uniform, span: undefined }] }],
|
|
224
|
+
[
|
|
225
|
+
'duplicate group and binding',
|
|
226
|
+
{ ...generic, boundGlobals: [uniform, { ...uniform, name: 'duplicate' }] },
|
|
227
|
+
],
|
|
228
|
+
[
|
|
229
|
+
'legacy material fallback',
|
|
230
|
+
{
|
|
231
|
+
schemaVersion: 'shader-reflection/2',
|
|
232
|
+
boundGlobals: [],
|
|
233
|
+
uvSetCount: 0,
|
|
234
|
+
material: { members: [] },
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
])('%s fails closed', async (_label, value) => {
|
|
238
|
+
const { parseReflectionWire } = await import('../index.js');
|
|
239
|
+
expect(() => parseReflectionWire(JSON.stringify(value))).toThrow();
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
116
244
|
{
|
|
117
245
|
// ─── from emit_reflection.test.ts ───
|
|
118
246
|
|
|
@@ -143,35 +271,6 @@ vi.mock('@forgeax/engine-wgpu-wasm', () => ({
|
|
|
143
271
|
expect(_emit_reflection).toHaveBeenCalledWith(validatedHandle, optionsJson);
|
|
144
272
|
});
|
|
145
273
|
|
|
146
|
-
it('preserves structured material member and resource facts from raw reflection', async () => {
|
|
147
|
-
const expectedJson = JSON.stringify({
|
|
148
|
-
bindings: [],
|
|
149
|
-
uvSetCount: 0,
|
|
150
|
-
material: {
|
|
151
|
-
members: [
|
|
152
|
-
{
|
|
153
|
-
name: 'albedoCoordinatesTransform',
|
|
154
|
-
type: 'vec4<f32>',
|
|
155
|
-
offset: 0,
|
|
156
|
-
size: 16,
|
|
157
|
-
alignment: 16,
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
resources: [{ name: 'albedo', kind: 'texture', binding: 2 }],
|
|
161
|
-
totalBytes: 16,
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
_emit_reflection.mockReturnValueOnce(expectedJson);
|
|
165
|
-
const { emit_reflection } = await import('../index.js');
|
|
166
|
-
const result = await emit_reflection({ _tag: 'ValidatedModule' }, '{}');
|
|
167
|
-
|
|
168
|
-
expect(result.ok).toBe(true);
|
|
169
|
-
if (result.ok) {
|
|
170
|
-
expect(JSON.parse(result.value).material.members[0].offset).toBe(0);
|
|
171
|
-
expect(JSON.parse(result.value).material.resources[0].binding).toBe(2);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
274
|
it('returns Result.err(ShaderError) with non-empty hint when raw emit_reflection throws', async () => {
|
|
176
275
|
_emit_reflection.mockImplementationOnce(() => {
|
|
177
276
|
throw new Error('reflection serialize failed: cyclic type graph');
|
|
@@ -101,11 +101,22 @@ describe('reflect-uv-set-count.test.ts', () => {
|
|
|
101
101
|
interface ReflectionOutput {
|
|
102
102
|
bindings: unknown;
|
|
103
103
|
uvSetCount: number;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
schemaVersion: 'shader-reflection/2';
|
|
105
|
+
boundGlobals: readonly {
|
|
106
|
+
group: number;
|
|
107
|
+
binding: number;
|
|
108
|
+
addressSpace: string;
|
|
109
|
+
resourceKind: string;
|
|
110
|
+
name?: string;
|
|
111
|
+
members?: readonly {
|
|
112
|
+
name: string;
|
|
113
|
+
type: string;
|
|
114
|
+
offset: number;
|
|
115
|
+
size: number;
|
|
116
|
+
alignment: number;
|
|
117
|
+
}[];
|
|
118
|
+
span?: number;
|
|
119
|
+
}[];
|
|
109
120
|
}
|
|
110
121
|
|
|
111
122
|
async function reflectWgsl(wgsl: string): Promise<ReflectionOutput> {
|
|
@@ -157,10 +168,52 @@ describe('reflect-uv-set-count.test.ts', () => {
|
|
|
157
168
|
});
|
|
158
169
|
});
|
|
159
170
|
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
describe('generic shader-reflection/2 bound globals', () => {
|
|
172
|
+
const WGSL_GENERIC_GLOBALS = `\
|
|
173
|
+
struct MaterialBlock {
|
|
174
|
+
tint: vec4<f32>,
|
|
175
|
+
roughness: f32
|
|
176
|
+
};
|
|
177
|
+
@group(0) @binding(0) var<uniform> renamedView: vec4<f32>;
|
|
178
|
+
@group(1) @binding(0) var<storage, read> unrelatedStorage: array<u32>;
|
|
179
|
+
@group(2) @binding(0) var<uniform> renamedMaterial: MaterialBlock;
|
|
180
|
+
@group(2) @binding(2) var materialTexture: texture_2d<f32>;
|
|
181
|
+
@group(2) @binding(5) var materialSampler: sampler;
|
|
182
|
+
@vertex fn vs() -> @builtin(position) vec4<f32> {
|
|
183
|
+
return renamedView + renamedMaterial.tint;
|
|
184
|
+
}
|
|
185
|
+
@fragment fn fs() -> @location(0) vec4<f32> {
|
|
186
|
+
return textureSample(materialTexture, materialSampler, vec2<f32>(0.0));
|
|
187
|
+
}`;
|
|
188
|
+
|
|
189
|
+
it('emits every bound global with generic facts, including binding gaps', async () => {
|
|
190
|
+
const r = await reflectWgsl(WGSL_GENERIC_GLOBALS);
|
|
191
|
+
expect(r.schemaVersion).toBe('shader-reflection/2');
|
|
192
|
+
expect(r.boundGlobals).toEqual(
|
|
193
|
+
expect.arrayContaining([
|
|
194
|
+
expect.objectContaining({ group: 0, binding: 0 }),
|
|
195
|
+
expect.objectContaining({ group: 1, binding: 0 }),
|
|
196
|
+
expect.objectContaining({ group: 2, binding: 0, addressSpace: 'uniform' }),
|
|
197
|
+
expect.objectContaining({ group: 2, binding: 2, resourceKind: 'texture' }),
|
|
198
|
+
expect.objectContaining({ group: 2, binding: 5, resourceKind: 'sampler' }),
|
|
199
|
+
]),
|
|
200
|
+
);
|
|
201
|
+
expect(r.boundGlobals).toHaveLength(5);
|
|
202
|
+
const material = r.boundGlobals.find((global) => global.group === 2 && global.binding === 0);
|
|
203
|
+
expect(material?.members).toEqual([
|
|
204
|
+
expect.objectContaining({ name: 'tint', type: 'vec4<f32>' }),
|
|
205
|
+
expect.objectContaining({ name: 'roughness', type: 'f32' }),
|
|
206
|
+
]);
|
|
207
|
+
expect(material?.span).toBeGreaterThan(0);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it('does not identify the material by global name', async () => {
|
|
211
|
+
const renamed = WGSL_GENERIC_GLOBALS.replaceAll('renamedMaterial', 'surfaceBlock');
|
|
212
|
+
const original = await reflectWgsl(WGSL_GENERIC_GLOBALS);
|
|
213
|
+
const changed = await reflectWgsl(renamed);
|
|
214
|
+
expect(changed.boundGlobals.map(({ name: _name, ...global }) => global)).toEqual(
|
|
215
|
+
original.boundGlobals.map(({ name: _name, ...global }) => global),
|
|
216
|
+
);
|
|
217
|
+
});
|
|
165
218
|
});
|
|
166
219
|
});
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,16 @@
|
|
|
18
18
|
// (plan-strategy §S-1 opaque handle invariant).
|
|
19
19
|
|
|
20
20
|
import { ensureReady } from '@forgeax/engine-wgpu-wasm';
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
err,
|
|
23
|
+
initFailed,
|
|
24
|
+
manifestMalformed,
|
|
25
|
+
ok,
|
|
26
|
+
type Result,
|
|
27
|
+
ShaderError,
|
|
28
|
+
type ShaderError as ShaderErrorType,
|
|
29
|
+
wrapShaderError,
|
|
30
|
+
} from './errors.js';
|
|
22
31
|
|
|
23
32
|
export {
|
|
24
33
|
compileFailed,
|
|
@@ -55,8 +64,7 @@ export type ParsedModule = unknown;
|
|
|
55
64
|
*/
|
|
56
65
|
export type ValidatedModule = unknown;
|
|
57
66
|
|
|
58
|
-
|
|
59
|
-
export interface RawMaterialMemberFact {
|
|
67
|
+
export interface ShaderReflectionMember {
|
|
60
68
|
readonly name: string;
|
|
61
69
|
readonly type: string;
|
|
62
70
|
readonly offset: number;
|
|
@@ -64,16 +72,162 @@ export interface RawMaterialMemberFact {
|
|
|
64
72
|
readonly alignment: number;
|
|
65
73
|
}
|
|
66
74
|
|
|
67
|
-
export interface
|
|
68
|
-
readonly
|
|
69
|
-
readonly kind: 'sampler' | 'texture' | 'storage-buffer';
|
|
75
|
+
export interface ShaderReflectionBoundGlobal {
|
|
76
|
+
readonly group: number;
|
|
70
77
|
readonly binding: number;
|
|
78
|
+
readonly addressSpace: string;
|
|
79
|
+
readonly resourceKind: string;
|
|
80
|
+
readonly visibility: number;
|
|
81
|
+
readonly name?: string;
|
|
82
|
+
readonly members?: readonly ShaderReflectionMember[];
|
|
83
|
+
readonly span?: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ShaderReflection {
|
|
87
|
+
readonly schemaVersion: 'shader-reflection/2';
|
|
88
|
+
readonly boundGlobals: readonly ShaderReflectionBoundGlobal[];
|
|
89
|
+
readonly uvSetCount: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
type ReflectionRecord = Record<string, unknown>;
|
|
93
|
+
|
|
94
|
+
function reflectionMalformed(reason: string): ShaderError {
|
|
95
|
+
return manifestMalformed({
|
|
96
|
+
message: `shader-reflection/2 is malformed: ${reason}`,
|
|
97
|
+
hint: 'rebuild the shader with the current Naga/WASM producer and preserve every bound-global fact',
|
|
98
|
+
reason,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function isRecord(value: unknown): value is ReflectionRecord {
|
|
103
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function requiredNonNegativeInteger(record: ReflectionRecord, key: string): number {
|
|
107
|
+
const value = record[key];
|
|
108
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0) {
|
|
109
|
+
throw reflectionMalformed(`boundGlobals entry requires non-negative integer '${key}'`);
|
|
110
|
+
}
|
|
111
|
+
return value;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function readMember(value: unknown, index: number): ShaderReflectionMember {
|
|
115
|
+
if (!isRecord(value)) throw reflectionMalformed(`member ${index} is not an object`);
|
|
116
|
+
const name = value.name;
|
|
117
|
+
const type = value.type;
|
|
118
|
+
if (
|
|
119
|
+
typeof name !== 'string' ||
|
|
120
|
+
name.length === 0 ||
|
|
121
|
+
typeof type !== 'string' ||
|
|
122
|
+
type.length === 0
|
|
123
|
+
) {
|
|
124
|
+
throw reflectionMalformed(`member ${index} requires name and type`);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
name,
|
|
128
|
+
type,
|
|
129
|
+
offset: requiredNonNegativeInteger(value, 'offset'),
|
|
130
|
+
size: requiredNonNegativeInteger(value, 'size'),
|
|
131
|
+
alignment: requiredNonNegativeInteger(value, 'alignment'),
|
|
132
|
+
};
|
|
71
133
|
}
|
|
72
134
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
135
|
+
function readBoundGlobal(value: unknown, index: number): ShaderReflectionBoundGlobal {
|
|
136
|
+
if (!isRecord(value)) throw reflectionMalformed(`boundGlobals entry ${index} is not an object`);
|
|
137
|
+
const addressSpace = value.addressSpace;
|
|
138
|
+
const resourceKind = value.resourceKind;
|
|
139
|
+
if (typeof addressSpace !== 'string' || addressSpace.length === 0) {
|
|
140
|
+
throw reflectionMalformed(`boundGlobals entry ${index} requires addressSpace`);
|
|
141
|
+
}
|
|
142
|
+
if (typeof resourceKind !== 'string' || resourceKind.length === 0) {
|
|
143
|
+
throw reflectionMalformed(`boundGlobals entry ${index} requires resourceKind`);
|
|
144
|
+
}
|
|
145
|
+
const visibility = requiredNonNegativeInteger(value, 'visibility');
|
|
146
|
+
const membersValue = value.members;
|
|
147
|
+
const hasMembers = membersValue !== undefined;
|
|
148
|
+
if (hasMembers && !Array.isArray(membersValue)) {
|
|
149
|
+
throw reflectionMalformed(`boundGlobals entry ${index} members must be an array`);
|
|
150
|
+
}
|
|
151
|
+
const hasSpan = value.span !== undefined;
|
|
152
|
+
if (resourceKind === 'buffer' || resourceKind === 'storage-buffer') {
|
|
153
|
+
if (!hasMembers || !hasSpan) {
|
|
154
|
+
throw reflectionMalformed(`buffer boundGlobals entry ${index} requires members and span`);
|
|
155
|
+
}
|
|
156
|
+
} else if (hasMembers !== hasSpan) {
|
|
157
|
+
throw reflectionMalformed(`boundGlobals entry ${index} members and span must be paired`);
|
|
158
|
+
}
|
|
159
|
+
if (value.name !== undefined && typeof value.name !== 'string') {
|
|
160
|
+
throw reflectionMalformed(`boundGlobals entry ${index} diagnostic name must be a string`);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
group: requiredNonNegativeInteger(value, 'group'),
|
|
164
|
+
binding: requiredNonNegativeInteger(value, 'binding'),
|
|
165
|
+
addressSpace,
|
|
166
|
+
resourceKind,
|
|
167
|
+
visibility,
|
|
168
|
+
...(value.name !== undefined ? { name: value.name as string } : {}),
|
|
169
|
+
...(hasMembers
|
|
170
|
+
? {
|
|
171
|
+
members: (membersValue as unknown[]).map((member, memberIndex) =>
|
|
172
|
+
readMember(member, memberIndex),
|
|
173
|
+
),
|
|
174
|
+
span: requiredNonNegativeInteger(value, 'span'),
|
|
175
|
+
}
|
|
176
|
+
: {}),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Parse and validate the business-neutral shader-reflection/2 wire. */
|
|
181
|
+
export function parseReflectionWire(json: string): ShaderReflection {
|
|
182
|
+
let parsed: unknown;
|
|
183
|
+
try {
|
|
184
|
+
parsed = JSON.parse(json);
|
|
185
|
+
} catch (cause) {
|
|
186
|
+
throw reflectionMalformed(cause instanceof Error ? cause.message : 'JSON.parse failed');
|
|
187
|
+
}
|
|
188
|
+
if (!isRecord(parsed) || parsed.schemaVersion !== 'shader-reflection/2') {
|
|
189
|
+
throw reflectionMalformed("schemaVersion must equal 'shader-reflection/2'");
|
|
190
|
+
}
|
|
191
|
+
if ('material' in parsed) throw reflectionMalformed('legacy material projection is not accepted');
|
|
192
|
+
if (!Array.isArray(parsed.boundGlobals)) {
|
|
193
|
+
throw reflectionMalformed('boundGlobals must be an array');
|
|
194
|
+
}
|
|
195
|
+
if (
|
|
196
|
+
typeof parsed.uvSetCount !== 'number' ||
|
|
197
|
+
!Number.isSafeInteger(parsed.uvSetCount) ||
|
|
198
|
+
parsed.uvSetCount < 0
|
|
199
|
+
) {
|
|
200
|
+
throw reflectionMalformed('uvSetCount must be a non-negative integer');
|
|
201
|
+
}
|
|
202
|
+
const boundGlobals = parsed.boundGlobals.map((global, index) => readBoundGlobal(global, index));
|
|
203
|
+
const coordinates = new Set<string>();
|
|
204
|
+
for (const global of boundGlobals) {
|
|
205
|
+
const coordinate = `${global.group}:${global.binding}`;
|
|
206
|
+
if (coordinates.has(coordinate))
|
|
207
|
+
throw reflectionMalformed(`duplicate bound-global coordinate ${coordinate}`);
|
|
208
|
+
coordinates.add(coordinate);
|
|
209
|
+
}
|
|
210
|
+
return { schemaVersion: 'shader-reflection/2', boundGlobals, uvSetCount: parsed.uvSetCount };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Result-form reader for callers that need an explicit unavailable/malformed branch. */
|
|
214
|
+
export function readReflectionWire(
|
|
215
|
+
json: string | undefined,
|
|
216
|
+
): Result<ShaderReflection, ShaderErrorType> {
|
|
217
|
+
if (json === undefined) {
|
|
218
|
+
return err(
|
|
219
|
+
initFailed({
|
|
220
|
+
message: 'shader-reflection/2 is unavailable before the Naga producer emits a wire',
|
|
221
|
+
hint: 'run the validated compose -> reflect path and retain its raw reflection bytes',
|
|
222
|
+
reason: 'reflection wire unavailable',
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
try {
|
|
227
|
+
return ok(parseReflectionWire(json));
|
|
228
|
+
} catch (error) {
|
|
229
|
+
return err(error instanceof ShaderError ? error : reflectionMalformed(String(error)));
|
|
230
|
+
}
|
|
77
231
|
}
|
|
78
232
|
|
|
79
233
|
// === Phase 1: parse =================================================================
|