<feed xmlns='http://www.w3.org/2005/Atom'>
<title>demo.git/src/util, branch main</title>
<subtitle>Vide-coded 64k demo system</subtitle>
<id>https://git.taar-o.com/demo.git/atom?h=main</id>
<link rel='self' href='https://git.taar-o.com/demo.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/'/>
<updated>2026-05-21T06:10:47Z</updated>
<entry>
<title>style: apply clang-format</title>
<updated>2026-05-21T06:10:47Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-05-21T06:10:47Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=d806027dcaeadcdd8d2febd88bc46b2fd2c465de'/>
<id>urn:sha1:d806027dcaeadcdd8d2febd88bc46b2fd2c465de</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: code review cleanup — bugs, dead code, factorization (-167 lines)</title>
<updated>2026-05-20T20:44:44Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-05-20T20:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=5d20c892dedce7bc7486acbd72fbd35da69e413e'/>
<id>urn:sha1:5d20c892dedce7bc7486acbd72fbd35da69e413e</id>
<content type='text'>
Bugs:
- B1: fix dead tempo debug (prev_tempo captured after assignment)
- B2: fix ReloadAssetsFromFile leak for disk-loaded assets; simplify DropAsset
- B3: fix get_free_pool_slot leak (unregister synth + free data on reuse)
- B4: volatile -&gt; std::atomic with acquire/release in miniaudio_backend, synth
- B5: fix unaligned reads in scene_loader (memcpy-based read_f32/read_u32)
- B6: fix shader module + BGL + pipeline layout leaks in gpu.cc, pipeline_builder

Dead code:
- D1: remove unused particle_defs.h
- D3: remove create_post_process_pipeline_simple (zero callers)
- D4: remove empty gpu_draw()
- D5: remove write-only Hybrid3D::initialized_
- D6: remove legacy pending buffer path in audio.cc

Factorization:
- F1: Effect::run_fullscreen_pass() replaces boilerplate in 5 effects
- F2: particle_common.wgsl snippet, #include in 3 WGSL shaders
- F3: gpu_create_shader_module() helper, used in 3 call sites
- F5: get_world_aabb() shared between bvh.cc and physics.cc
- F6: samples_to_seconds() replaces 6 inline expressions
- F7: gpu_create_linear/nearest_sampler use SamplerCache; add nearest() preset

37/37 tests passing.

handoff(Claude): code review batch — all items verified, no regressions.
</content>
</entry>
<entry>
<title>ans: order-0 rANS coder + WGSL asset compression</title>
<updated>2026-05-14T17:11:28Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-05-14T17:09:39Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=6ef8f578817ee0134fd5867ca3b80590e3eb2368'/>
<id>urn:sha1:6ef8f578817ee0134fd5867ca3b80590e3eb2368</id>
<content type='text'>
Adds src/util/ans.{h,cc}, a per-chunk-adaptive order-0 rANS entropy
coder. Decoder is always built; encoder is gated on ANS_ENABLE_ENCODER
(tools only). Both sides take an optional 256-entry initial_counts
table to seed the adaptive model.

The per-chunk initial state is (1 &lt;&lt; kBits). Higher initial states
(e.g. with a signature packed into the upper bits) force a renorm-emit
at iter 0 that the decoder never consumes, corrupting multi-chunk
streams once stats become skewed.

Asset pipeline:
- AssetRecord gains 'compression' and 'uncompressed_size' fields.
- asset_packer scans every WGSL file to build a corpus-wide byte
  histogram, then ANS-encodes each shader using that histogram as the
  seed. Histogram and accessor are emitted alongside the asset table.
  Round-trip verification runs at pack time for every compressed
  asset; failures fall back to uncompressed storage.
- asset_manager decompresses on first GetAsset(), caches the
  heap-allocated buffer, and DropAsset / ReloadAssetsFromFile free it
  along with the procedural cache.
- Disk-load (dev) builds are unchanged: WGSL paths stay as filenames.

Tests:
- src/tests/util/test_ans.cc: roundtrip variants (empty, single byte,
  single-symbol run, all-zeros, random uniform/skewed, repeated ASCII),
  seeded-vs-uniform compression, rejection of mismatched counts /
  corruption / truncation, PeekUncompressedSize.
- 37/37 dev, 36/36 STRIP_ALL.

Compression observed: WGSL shaders shrink to ~0.62-0.71x in the main
workspace (81 of 105 assets qualify).

Docs:
- doc/ANS.md (new): algorithm, bitstream, API, asset pipeline
  integration, compression numbers, limitations, tests.
- doc/ASSET_SYSTEM.md: new Compression section + updated technical
  guarantees for compressed assets.
- doc/COMPLETED.md: May 2026 entry.
- PROJECT_CONTEXT.md: Build status line mentions WGSL ANS compression.
- CLAUDE.md, GEMINI.md: tier-3 build doc list includes ANS.md.
</content>
</entry>
<entry>
<title>feat(procedural): add plasma, voronoi, normalmap generators</title>
<updated>2026-03-29T00:42:28Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-29T00:42:28Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=70b77307a9a9ee4fdff23f783e041fe49e60e100'/>
<id>urn:sha1:70b77307a9a9ee4fdff23f783e041fe49e60e100</id>
<content type='text'>
Add three new procedural texture generators:
- gen_plasma: classic sine-sum color texture (RGB output)
- gen_voronoi: Worley cellular noise (F1/F2/F2-F1 modes)
- gen_normalmap: post-process grayscale→RGB normal map

Remove gen_noise_256 (was an alias for gen_noise). Register new
generators in asset_manager and asset_packer. Add unit tests for
all three, and use them in test_3d_render (plasma sky, voronoi noise,
fBm normal map).

handoff(Gemini): plasma/voronoi/normalmap procedural generators added;
gen_noise_256 removed; tests + 3d_render usage wired up.
</content>
</entry>
<entry>
<title>fix(win): update wgpu-native to v27, unify Windows/macOS API paths</title>
<updated>2026-03-12T16:14:57Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-12T16:14:57Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=efad11008616d30f685752fc70aa05be524c1a78'/>
<id>urn:sha1:efad11008616d30f685752fc70aa05be524c1a78</id>
<content type='text'>
- fetch_win_deps.sh: update wgpu-native v0.19.4.1 → v27.0.4.0 (same as macOS)
- platform.h: remove v0.19 compat shims, Windows now uses WGPUStringView API
- gpu.cc/gpu.h: remove DEMO_CROSS_COMPILE_WIN32 old-API branches
- texture_readback.cc, visual_debug.cc, hybrid3d_effect.cc: same cleanup
- rotating_cube_effect.cc: remove #ifdef guard for depthSlice
- glfw3webgpu.c: remove old WGPUSurfaceDescriptorFromWindowsHWND branch
- asset_manager.cc: fix DEMO_STRIP_ALL→STRIP_ALL guard (vs_main was missing
  in STRIP_ALL Windows builds because disk-loading path ran on embedded data)
- tracker.cc: skip MP3 assets gracefully in STRIP_ALL builds instead of fatal

handoff(Gemini): Windows .exe now runs under Wine. demo64k.exe renders frames
and progresses through audio timeline. Pre-existing test failures unchanged.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix: negate Y in perspective() to correct rasterized 3D orientation</title>
<updated>2026-03-08T10:36:04Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-08T10:36:04Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=ba7ea27ddee4398afa98a0e45b9e227bbcfae906'/>
<id>urn:sha1:ba7ea27ddee4398afa98a0e45b9e227bbcfae906</id>
<content type='text'>
The fullscreen post-process VS uses Y-up UVs (uv.y=0 = bottom), so
textureSample() Y-flips any rasterized offscreen texture. SDF effects
author their content Y-down and look correct after the flip. Rasterized
effects (RotatingCube, Hybrid3D) must pre-flip their geometry:

- mat4::perspective(): m[5] = -t (negated Y scale)
- Pipelines with cullMode=Back: frontFace = WGPUFrontFace_CW (Y-flip
  reverses winding, so CW becomes the visible face)
- Remove incorrect transposes from GlobalUniforms::make(),
  ObjectData::make(), and Uniforms::make() — mini_math is column-major,
  no transpose needed for GPU upload
- Document the convention in doc/3D.md under "Rasterized 3D and the
  Y-flip rule"

handoff(Gemini): Y-flip rule now documented; all rasterized 3D pipelines
must follow it.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: WGSL asset load-from-disk in dev mode</title>
<updated>2026-03-08T09:13:01Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-08T09:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=1438cfe727adc7b6a5d84c76b0878ed77ef254a8'/>
<id>urn:sha1:1438cfe727adc7b6a5d84c76b0878ed77ef254a8</id>
<content type='text'>
- asset_packer: include WGSL in --disk_load path storage (alongside SPEC/MP3)
- asset_manager: disk-load WGSL assets at runtime when !DEMO_STRIP_ALL
- DemoCodegen: pass ASSET_PACKER_FLAGS to pack_test_assets so test assets
  also use disk-load paths in dev mode (fixes pre-existing SPEC/WGSL test failures)
- test_shader_composer: fix stale assertions (fn test_wgsl → fn snippet_a,
  correct ordering check)

35/35 tests passing.

handoff(Claude): WGSL disk-loading implemented. Shaders now loaded from disk
in dev mode, enabling hot-reload without rebuild. Tests fixed.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix: Resolve compile error in GetAssetType</title>
<updated>2026-03-08T08:33:55Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-08T08:33:55Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=deecfe84810cb1915d66474978f845c885bfa576'/>
<id>urn:sha1:deecfe84810cb1915d66474978f845c885bfa576</id>
<content type='text'>
Replaced the deleted 'AssetType::STATIC' with 'AssetType::BINARY' as the default return value for invalid asset IDs.
</content>
</entry>
<entry>
<title>feat: Implement dual-mode asset loading and update documentation</title>
<updated>2026-03-08T08:33:17Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-08T08:33:17Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=a2f0f7c7a45ba8b30984fb135b8b54f11fb119f8'/>
<id>urn:sha1:a2f0f7c7a45ba8b30984fb135b8b54f11fb119f8</id>
<content type='text'>
This commit introduces a dual-mode asset loading system to enhance developer workflow and optimize release builds.

Key changes include:
- **Dual-Mode Asset Loading:** Assets are now loaded from disk during development (when  is OFF) for faster iteration, particularly for heavy assets like  and  files. For release builds ( ON), all assets are embedded directly into the binary, ensuring a single, self-contained executable.
- **Explicit Asset Typing:** Replaced generic  asset type with specific types (, , , , ) in  and the  enum in  for clearer categorization and more robust processing.
- **Build System Integration:** Modified  to pass a  flag to  in development builds.
- **Asset Packer Updates:**  now generates file paths for disk-loaded assets and embeds data for others based on the build mode.
- **Asset Manager Enhancements:**  includes new logic in  for loading and caching disk-based assets and updates to  for proper memory deallocation.
- **Documentation:** Updated  to reflect the new asset nomenclature and dual-mode loading strategy.
- **Project Rules:** Added a concise rule to  mandating top-level documentation updates for medium/large sub-system changes.

handoff(Gemini): Implemented dual-mode asset loading and updated documentation.
</content>
</entry>
<entry>
<title>style: run clang-format to adhere to coding style</title>
<updated>2026-03-05T21:55:56Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-05T21:55:56Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=34afbd6ca21d2b960573d787e6eae46fa86b200e'/>
<id>urn:sha1:34afbd6ca21d2b960573d787e6eae46fa86b200e</id>
<content type='text'>
</content>
</entry>
</feed>
