JsRuntimeHost has no streaming body surface: Response.body, a constructible Response, Blob.slice()/stream() and the Streams globals are missing, so SPZ and progressive 3D loaders cannot run
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp, javascript
- 領域
- backend, mobile-dev
調査の方向性
Start with the Fetch and Blob polyfills under Dependencies/JsRuntimeHost/Polyfills/, especially Fetch.cpp, Blob.cpp, and Fetch/Readme.md; then review the linked JsRuntimeHost PRs for reference contracts. Map how UrlLib delivers progress and data callbacks before choosing an implementation approach. Done means the requested streaming Response, Blob, and Streams APIs work together with transport backpressure and completion callbacks.
索引モデルが issue の本文から書いたものです。
説明
Summary
#1825 tracks the SPZ loader symptom (ReadableStream is not defined, 3 scenes). This issue tracks the platform gap behind it, which is wider than one global and affects every large-asset loader, not only SPZ.
The fetch/Blob stack has no streaming surface at all: Response has no body and is not a constructor, Blob has no slice() or stream(), and there are no ReadableStream, DecompressionStream or TextDecoderStream globals. Bodies are fully buffered before the promise resolves. The first byte of an asset becomes visible only after its last byte has arrived, and loaders written against the standard streaming APIs throw.
For large 3D assets this removes the pipeline that makes them loadable at all on mobile: header sniffing before the payload lands, decode of chunk n overlapped with download of chunk n+1, GPU upload of early chunks while later ones are still in flight, and progressive display of a splat scene or glTF. Instead the JS thread sits idle during the download, then does the entire decode in one burst.
What is missing (BabylonNative master @ e79a4e3, Dependencies/JsRuntimeHost)
Responseis a plain object exposingtext/arrayBuffer/json/blob/cloneonly; nobody, nobytes(): Fetch.cpp#L251-L334. There is no globalResponseconstructor, sonew Response(...)is aReferenceError.Blobexposessize/type/text/arrayBuffer/bytesonly; noslice(), nostream(): Blob.cpp#L17-L21.Filelikewise: File.cpp#L46-L48.- No Streams polyfill of any kind under
Polyfills/(AbortController, Blob, Console, Fetch, File, Performance, Scheduling, TextDecoder, TextEncoder, URL, WebSocket, XMLHttpRequest). - Full buffering before resolve is documented as the contract: Fetch/Readme.md#L18.
Who breaks
- SPZ (Niantic's compressed splat container, now the common interchange for splat scenes): Babylon.js's non-WASM decode path builds a
ReadableStream, pipes it throughnew DecompressionStream("gzip"), and reads the result withnew Response(stream).arrayBuffer()(splatFileLoader.pure.ts#L448-L458). Here that throws, thecatchfalls through to the PLY parser, and the file is mis-parsed. WebRequest.FetchAsync's XHR fallback wraps the result innew Response(request.response, ...)(webRequest.ts#L138); it is used by the scene loader's HEAD probe (sceneLoader.ts#L691), audio loading and the flow-graph parser.- Streamed splat LODs download whole files per LOD with no partial consumption (gaussianSplattingDownloadManager.ts#L310); with a streamed body the decoder could start on the first chunk and the renderer could show the coarse LOD while fine ones arrive.
- glTF/GLB, KTX2 and USDZ readers that inspect a header or table of contents before committing to the full payload have no way to do so.
Proposed shape
response.body: aReadableStreamwhose chunks come from UrlLib's progress/data callbacks with backpressure honored by the transport. Reads should settle from the transport's completion callback, not from a timer that polls on the JS thread; the goal is to keep this pipeline off the CPU as much as possible so the GPU keeps its headroom.bytes(), and a constructibleResponseacceptingBufferSource | Blob | ReadableStream | string, sonew Response(stream).arrayBuffer()works as the standard streaming-to-buffer idiom.Blob.slice()as an offset/length view over a shared immutable backing (zero copy), andBlob.stream().- The streams primitives (
ReadableStream,WritableStream,TransformStream,DecompressionStream/CompressionStream,TextDecoderStream) as an optional polyfill module, so hosts that bring their own can skip it.
PRs BabylonJS/JsRuntimeHost#208, #209, #210 and #211 (opened against the now-archived JsRuntimeHost repository) implement most of this (WHATWG Streams, Blob slicing and streaming, Headers plus streamed Response bodies, Compression Streams) and can serve as the reference for the contract above even if the final implementation differs.
#1825 covers the SPZ symptom only; JsRuntimeHost#98 (Implement fetch API) and JsRuntimeHost#213 (blob: URL resolution) predate the gap described here.
- 主要言語
- C++
- スター
- 931
- フォーク
- 169
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 66
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
BabylonJS/BabylonNative のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
BabylonJS/BabylonNative#2138 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
BabylonJS/BabylonNative#2042 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
BabylonJS/BabylonNative#2052 ·
メンテナーはふだん 1 日以内に返信
-
testing
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
BabylonJS/BabylonNative#2136 ·
メンテナーはふだん 1 日以内に返信
-
Support useNDCHalfZRange (half-range NDC depth) so Babylon.js half-range depth visual tests can runオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
BabylonJS/BabylonNative#2134 ·
メンテナーはふだん 1 日以内に返信
BabylonJS/BabylonNative の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
simnJS/AnyPS5#735 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Niko1221/Strata#7719 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
area:tests kind:test
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信