<feed xmlns='http://www.w3.org/2005/Atom'>
<title>demo.git/cnn_v3/src, 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, simplification</title>
<updated>2026-05-20T21:21:59Z</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=a91f89c8ea15665853176c05597760d0fcf6e0df'/>
<id>urn:sha1:a91f89c8ea15665853176c05597760d0fcf6e0df</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

Simplification:
- S9+S1: WgslSamplerType param; Scene2Effect collapsed to thin wrapper
- S4: FFT heap allocs -&gt; stack arrays (zero allocs on hot path)
- S5: ObjectType::CUBE documented as legacy alias for BOX; default changed
- S6: bind group dirty-flag in Renderer3D; remove duplicate pipeline set
- S7: create_gpu_procedural() helper in texture_manager (~80 lines removed)

37/37 tests passing.

handoff(Claude): code review batch — all items verified, no regressions.
</content>
</entry>
<entry>
<title>fix(cnn_v3): remove dec0 ReLU, load FiLM MLP at runtime</title>
<updated>2026-03-27T06:59:00Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-27T06:59:00Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=fb13e67acbc7d7dd2974a456fcb134966c47cee0'/>
<id>urn:sha1:fb13e67acbc7d7dd2974a456fcb134966c47cee0</id>
<content type='text'>
Two bugs blocking training convergence:

1. dec0 ReLU before sigmoid constrained output to [0.5,1.0] — network
   could never produce dark pixels. Removed F.relu in train_cnn_v3.py
   and max(0,…) in cnn_v3_dec0.wgsl. Test vectors regenerated.

2. set_film_params() used hardcoded heuristics instead of the trained MLP.
   Added CNNv3FilmMlp struct + load_film_mlp() to cnn_v3_effect.h/.cc.
   MLP auto-loaded from ASSET_WEIGHTS_CNN_V3_FILM_MLP at construction;
   Linear(5→16)→ReLU→Linear(16→72) runs CPU-side each frame.

36/36 tests pass. Parity max_err=4.88e-4 unchanged.

handoff(Gemini): retrain from scratch — needs ≥50 samples (currently 11).
See cnn_v3/docs/HOWTO.md §2-3.
</content>
</entry>
<entry>
<title>feat(cnn_v3): upgrade architecture to enc_channels=[8,16]</title>
<updated>2026-03-26T06:03:01Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-26T06:03:01Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=8f14bdd66cb002b2f89265b2a578ad93249089c9'/>
<id>urn:sha1:8f14bdd66cb002b2f89265b2a578ad93249089c9</id>
<content type='text'>
Double encoder capacity: enc0 4→8ch, enc1 8→16ch, bottleneck 16→16ch,
dec1 32→8ch, dec0 16→4ch. Total weights 2476→7828 f16 (~15.3 KB).
FiLM MLP output 40→72 params (L1: 16×40→16×72).

16-ch textures split into _lo/_hi rgba32uint pairs (enc1, bottleneck).
enc0 and dec1 textures changed from rgba16float to rgba32uint (8ch).
GBUF_RGBA32UINT node gains CopySrc for parity test readback.

- WGSL shaders: all 5 passes rewritten for new channel counts
- C++ CNNv3Effect: new weight offsets/sizes, 8ch uniform structs
- Web tool (shaders.js + tester.js): matching texture formats and bindings
- Parity test: readback_rgba32uint_8ch helper, updated vector counts
- Training scripts: default enc_channels=[8,16], updated docstrings
- Docs + architecture PNG regenerated

handoff(Gemini): CNN v3 [8,16] upgrade complete. All code, tests, web
tool, training scripts, and docs updated. Next: run training pass.
</content>
</entry>
<entry>
<title>feat(cnn_v3): 3×3 dilated bottleneck + Sobel loss + FiLM warmup + architecture PNG</title>
<updated>2026-03-25T09:05:42Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-25T09:05:42Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=ce6e5b99f26e4e7c69a3cacf360bd0d492de928c'/>
<id>urn:sha1:ce6e5b99f26e4e7c69a3cacf360bd0d492de928c</id>
<content type='text'>
- Replace 1×1 pointwise bottleneck with Conv(8→8, 3×3, dilation=2):
  effective RF grows from ~13px to ~29px at ¼res (~+1 KB weights)
- Add Sobel edge loss in training (--edge-loss-weight, default 0.1)
- Add FiLM 2-phase training: freeze MLP for warmup epochs then
  unfreeze at lr×0.1 (--film-warmup-epochs, default 50)
- Update weight layout: BN 72→584 f16, total 1964→2476 f16 (4952 B)
- Cascade offsets in C++ effect, JS tool, export/gen_test_vectors scripts
- Regenerate test_vectors.h (1238 u32); parity max_err=9.77e-04
- Generate dark-theme U-Net+FiLM architecture PNG (gen_architecture_png.py)
- Replace ASCII art in CNN_V3.md and HOW_TO_CNN.md with PNG embed

handoff(Gemini): bottleneck dilation + Sobel loss + FiLM warmup landed.
Next: run first real training pass (see cnn_v3/docs/HOWTO.md §3).
</content>
</entry>
<entry>
<title>fix(cnn_v3_debug): add CNNv3Effect to debug sequence for prev.r/g/b temporal feedback</title>
<updated>2026-03-23T07:05:12Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-23T07:05:12Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=47312588d0ef37ea7ef19c97bc5089d419ae3cd9'/>
<id>urn:sha1:47312588d0ef37ea7ef19c97bc5089d419ae3cd9</id>
<content type='text'>
timeline.seq is the canonical source — timeline.cc was wrongly hand-edited.
Add CNNv3Effect + cnn_out (gbuf_albedo) node to cnn_v3_debug sequence so
wire_dag() can wire GBufferEffect.cnn_output_node_ correctly.
Also fix node_prev_tex_ NodeType: F16X8 (Rgba16Float+CopyDst) to match
CNNv3Effect output format (GBUF_ALBEDO = Rgba16Float).

Regenerated timeline.cc via: python3 tools/seq_compiler.py workspaces/main/timeline.seq

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat(gbuffer): wire_dag() + find_downstream_output() for temporal feedback</title>
<updated>2026-03-23T06:54:18Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-23T06:54:18Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=491a3c1ccbd0f46be655e97d2e3697135df6e3a2'/>
<id>urn:sha1:491a3c1ccbd0f46be655e97d2e3697135df6e3a2</id>
<content type='text'>
- Add Effect::wire_dag() virtual (called from init_effect_nodes after full DAG built)
- Add Effect::find_downstream_output() protected helper (first downstream consumer output)
- GBufferEffect::wire_dag() auto-sets cnn_output_node_ via find_downstream_output,
  guarding against sink (external view, null texture)
- GBufferEffect::post_render() null-checks src texture before CopyTextureToTexture
- Tests: find_downstream_output cases + wire_dag integration in test_effect_base
- Doc: SEQUENCE.md updated with wire_dag pattern, helper contract, and sink guard

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat(cnn_v3): GBufferEffect temporal feedback via post_render()</title>
<updated>2026-03-23T06:31:14Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-23T06:31:14Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=1e3813355e37f903314ec2069ff788c6f69becfd'/>
<id>urn:sha1:1e3813355e37f903314ec2069ff788c6f69becfd</id>
<content type='text'>
- Add Effect::post_render() virtual hook, called after all effects in
  the sequence have rendered each frame. Default is no-op.
- Sequence::render_effects() runs a second pass invoking post_render()
  on all DAG nodes after the render pass completes.
- GBufferEffect: declare internal node_prev_tex_ (U8X4_NORM) for
  persistent prev-frame CNN output. post_render() copies cnn_output_node_
  → node_prev_tex_ via CopyTextureToTexture. render() binds node_prev_tex_
  as prev_cnn (binding 6) — zero on frame 0 (matches training convention).
- Expose set_cnn_output_node(name) API; call once at setup.
- Drop brittle ping-pong / input_nodes_[0] fallback.
- Update doc/SEQUENCE.md: post_render() semantics, frame execution order,
  temporal feedback canonical pattern, node types table with G-buffer types.
- Update cnn_v3/docs/HOWTO.md: temporal feedback wiring section.

36/36 tests passing.

handoff(Gemini): prev.rgb temporal feedback now correct and generic.
Set set_cnn_output_node("sink") (or CNN output node name) once at setup.
</content>
</entry>
<entry>
<title>wip(cnn_v3): shadow→dif intermediate + scene tweaks + migration plan</title>
<updated>2026-03-22T23:26:52Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-22T23:26:52Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=1470dd240f48652d1fe97957fe44a49b0e1ee9a6'/>
<id>urn:sha1:1470dd240f48652d1fe97957fe44a49b0e1ee9a6</id>
<content type='text'>
- gbuf_shadow.wgsl: normal bias 0.05→0.02
- gbuf_pack.wgsl: compute dif=diffuse*shadow, drop shadow from t1.z,
  store dif in t1.w (INTERMEDIATE — incorrect packing, see migration plan)
- gbuf_deferred.wgsl: read dif from t1.w.x (matches intermediate packing)
- gbuf_view.wgsl: expand to 4×6 grid, show dif.r/g/b in row 5
  (INTERMEDIATE — to be reverted to 4×5 with ch18=dif)
- gbuffer_effect.cc: add small hovering sphere (r=0.6) above scene;
  swap cube/sphere positions; both spheres pulsate
- docs/GBUF_DIF_MIGRATION.md: full migration plan with checklist

handoff(Claude): intermediate commit — GBUF_DIF_MIGRATION.md §Current State
describes what is wrong and the full implementation checklist (5 steps).
</content>
</entry>
<entry>
<title>refactor(cnn_v3): simplify sphere SDF in shadow pass, remove per-frame alloc</title>
<updated>2026-03-22T22:51:40Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-03-22T22:51:40Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=12d5d5f1762a0c00405950b6ff5e564880f0ff36'/>
<id>urn:sha1:12d5d5f1762a0c00405950b6ff5e564880f0ff36</id>
<content type='text'>
gbuf_shadow.wgsl — dfWithID():
- Sphere: replace inv_model local-space transform with direct world-space
  formula (length(p - center) - radius). Exact, no matrix multiply, no
  floating-point error from matrix inversion that can corrupt soft-shadow
  penumbra over 64 march steps.
- lp/scale now computed only inside the cases that need them (box/torus/plane)
  instead of eagerly for every object.

gbuffer_effect.cc — upload_scene_data():
- Replace per-frame std::vector&lt;GBufObjectData&gt; heap allocation with a
  file-static staging buffer s_obj_staging[256]: zero alloc per frame.

handoff(Gemini): sphere SDF now exact; shadow march should be cleaner.
</content>
</entry>
</feed>
