Add processed assets and improve browser rendering and runtime support - #4040
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed correctness issues in the changed code (notably exception-safe cleanup in binary_save and an immutable header buffer being written via _builtin_read) that should be fixed before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR expands daslang’s portable rendering + browser workflow support by introducing processed glTF assets (packed geometry + BC textures), adding meshoptimizer and texture-block compression modules, and improving runtime/browser lifecycle correctness (binary-save buffer ownership, ImGui callback teardown, WebAudio mixing threading, and live capture transport).
Changes:
- Add new stdlib-facing modules:
meshoptimizer,stbimage/texture_blocks, andgltf/gltf_processed(+ docs + tests). - Improve runtime/browser correctness: reclaim
binary_savetemporary buffers, add Emscripten ImGui callback ownership/teardown, and move WebAudio mixing off the AudioWorklet thread. - Add live capture/report transport for browser workflows (JS adapter + daslang provider/restore module + tests).
File summaries
| File | Description |
|---|---|
| utils/daspkg/README.md | Document WASM symbol inclusion behavior |
| utils/daspkg/commands.das | Add include-symbols support to wasm release pipeline |
| tests/language/bin_serializer.das | Add regression tests for serializer stride + buffer reclaim |
| tests/dasGLTF/test_gltf_processed.das | Validate processed asset roundtrip + rejection cases |
| tests/dasGLTF/test_gltf_pbr_common.das | Add shadow math regression tests |
| tests/dasGLTF/test_gltf_atmosphere.das | Add atmosphere transmittance regression test |
| src/simulate/bin_serializer.cpp | Fix array element stride + free save buffers post-callback |
| skills/daslang/references/everything.md | Register new modules and public symbols in reference |
| modules/dasStbImage/tests/test_texture_blocks.das | Add texture blocks mip/cache/decode tests |
| modules/dasStbImage/tests/test_allocation_limits.das | Ensure large outputs reserve under allocation limits |
| modules/dasStbImage/stbimage/texture_blocks.das | Implement BC compression/mips/cache/validation/decode |
| modules/dasStbImage/src/stb_dxt.version | Track vendored stb_dxt provenance |
| modules/dasStbImage/src/dasStbImage.h | Add native compression function declaration |
| modules/dasStbImage/src/dasStbImage.cpp | Implement + bind stb_compress_blocks |
| modules/dasStbImage/src/dasStbImage_impl.cpp | Compile stb_dxt implementation into module |
| modules/dasStbImage/README.md | Document texture block compression APIs |
| modules/dasStbImage/CMakeLists.txt | Wire stb_dxt + AOT .das into build |
| modules/dasStbImage/.das_module | Register stbimage/texture_blocks native path |
| modules/dasMeshOptimizer/vendor/src/vfetchoptimizer.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/src/stripifier.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/src/spatialorder.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/src/rasterizer.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/src/quantization.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/src/overdrawoptimizer.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/src/indexanalyzer.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/src/allocator.cpp | Vendor meshoptimizer source |
| modules/dasMeshOptimizer/vendor/LICENSE.md | Vendor meshoptimizer license |
| modules/dasMeshOptimizer/tests/test_meshoptimizer.das | Add meshoptimizer binding tests |
| modules/dasMeshOptimizer/tests/test_allocation_limits.das | Ensure large outputs reserve under limits |
| modules/dasMeshOptimizer/src/dasMeshOptimizer.h | Add AOT header for bindings |
| modules/dasMeshOptimizer/src/dasMeshOptimizer.cpp | Implement checked bindings + module registration |
| modules/dasMeshOptimizer/README.md | Document meshoptimizer module contract |
| modules/dasMeshOptimizer/MESHOPTIMIZER.LICENSE | Install-facing license file |
| modules/dasMeshOptimizer/CMakeLists.txt | Add module build + install rules |
| modules/dasMeshOptimizer/.das_module | Register dynamic module for dll builds |
| modules/dasLiveHost/web/README.md | Document browser live capture transport |
| modules/dasLiveHost/web/live_capture.js | Implement browser FS mailbox + UI + upload/download |
| modules/dasLiveHost/tests/test_live_capture.das | Add provider/restore correctness tests |
| modules/dasLiveHost/tests/test_capture_transport.cjs | Add node-based transport regression test |
| modules/dasLiveHost/live/README_capture.md | Document registered capture providers and invariants |
| modules/dasLiveHost/live/live_capture.das | Implement live capture registry, validate, restore, mailbox |
| modules/dasLiveHost/.das_module | Register live_capture native path |
| modules/dasImgui/widgets/imgui_live.das | Add arch citation for browser callback routing |
| modules/dasImgui/widgets/imgui_drawlist_builtin.das | Add drawlist primitives with live registration |
| modules/dasImgui/widgets/imgui_boost_runtime.das | Fix snapshot payload ownership + unsafe tightening |
| modules/dasImgui/tests/test_snapshot_payload_ownership.das | Test payload ownership transfer on snapshot |
| modules/dasImgui/src/module_imgui_app.cpp | Emscripten callback install/teardown ownership fixes |
| modules/dasImgui/REVIEW.md | Point checklist at ARCHITECTURE.md |
| modules/dasImgui/ARCHITECTURE.md | Add browser callback routing architecture doc |
| modules/dasGLTF/tools/convert.das | Add processed glTF conversion tool |
| modules/dasGLTF/tests/test_surface_controls.das | Add surface default behavior tests |
| modules/dasGLTF/tests/test_rendering_contracts.das | Add packed geometry contract tests |
| modules/dasGLTF/README.md | Document processed assets + optional rendering paths |
| modules/dasGLTF/gltf/gltf_scene.das | Add overload to eval animation clips by value |
| modules/dasGLTF/gltf/gltf_processed_gl.das | Add GL upload path for processed assets + pools |
| modules/dasGLTF/gltf/gltf_pbr_common.das | Add shadow PCF/receiver-plane helpers |
| modules/dasGLTF/gltf/gltf_gl.das | Track missing-attribute defaults + texture borrowing/pooling |
| modules/dasGLTF/gltf/gltf_atmosphere.das | Add atmosphere transmittance helper module |
| modules/dasGLTF/ARCHITECTURE.md | Add architecture notes for new math/format behavior |
| modules/dasGLTF/.das_module | Register new gltf module paths |
| modules/dasAudio/src/dasAudio.cpp | Move WebAudio mixing to pthread ring-buffer worker |
| modules/dasAudio/CMakeLists.txt | Update threaded web build description |
| modules/dasAudio/ARCHITECTURE.md | Document threaded WASM audio architecture rationale |
| doc/source/stdlib/sec_media.rst | Include generated docs for new modules |
| doc/source/stdlib/handmade/module-texture_blocks.rst | Add module blurb for docs build |
| doc/source/stdlib/handmade/module-meshoptimizer.rst | Add module blurb for docs build |
| doc/source/stdlib/handmade/module-gltf_processed.rst | Add module blurb for docs build |
| doc/source/stdlib/handmade/function-stbimage-stb_compress_blocks-0xcc27189d5d081eae.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_remap_vertices-0xe33b3a97b651e4e8.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_remap_indices-0x69706c78732a40b2.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_optimize_fetch-0xcd80344cb34f875f.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_optimize_cache-0x9f5637f748a14874.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_generate_remap-0xdbd2de7ee479a3c2.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_encode_vertices-0xe1ad9380a82a899d.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_encode_indices-0xcebc111796f37b7c.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_decode_vertices-0x25019ef686d88461.rst | Add function blurb for docs build |
| doc/source/stdlib/handmade/function-meshoptimizer-meshopt_decode_indices-0xc16e60c000f53bf4.rst | Add function blurb for docs build |
| doc/reflections/das2rst.das | Register new modules for doc generation |
| daslib/fio.das | Minor fread/fload changes (header read + emptiness check) |
| daslib/daspkg.das | Add arch citation for release symbol option |
| daslib/ARCHITECTURE.md | Document release symbols option plumbing |
| CMakeLists.txt | Add build toggle for dasMeshOptimizer |
Review details
- Files reviewed: 76/98 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
e6692b3 to
9ec9787
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The current diff introduces non-portable hard-coded /tmp paths in a new test and a comment-hygiene violation that should be fixed before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 76/76 changed files
- Comments generated: 2
- Review effort level: Lite
Fetch meshoptimizer 1.2 through a checksum-pinned CMake dependency. Add checked mesh codecs, BC texture compression and fallback decoding, processed glTF containers, packed GPU geometry and shared texture ownership. Extend PBR rendering with local shadows, atmospheric attenuation and optional surface/material buffers. Preserve skin attributes and draw-time vertex defaults, and evaluate shadow derivatives before varying bounds checks. Fix binary-array allocation stride and release serialization buffers after normal and failed callbacks. Move threaded WebAudio mixing to a pthread-fed PCM ring. Correct browser input callback teardown and snapshot payload ownership, add registered live capture/report transport, and honor Wasm release symbol requests. Add focused regression coverage and public API documentation.
9ec9787 to
42f7024
Compare
There was a problem hiding this comment.
🟡 Changes recommended
mo_fetch can overflow used*stride before the size check on 32-bit targets, risking under-allocation and out-of-bounds writes.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 76/76 changed files
- Comments generated: 2
- Review effort level: Lite
Behavior changes: binary-save buffers are released after callbacks, and processed loads reject invalid geometry before upload.
Why. Portable rendering and browser workflows need compact assets, reliable audio, and reproducible state captures.
What changes.
Observable behavior.
Where to look. Asset processing lives in
dasGLTF,dasMeshOptimizer, anddasStbImage; lifecycle changes are indasAudio,dasImgui, anddasLiveHost.Validation, claims, ledger
Validation
Claims - stated, not tested
Not done