summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
15 hoursfix(cnn_v3): blender_export discard dir next to --output, not in /tmpskal
15 hoursfix(cnn_v3): blender_export.py Blender 5 File Output node slots + file_nameskal
- Prefer file_output_items over file_slots; use explicit is-None checks so empty collections do not fall through to the legacy attribute. - Clear out_node.file_name so multilayer EXR frames are named 0001.exr instead of file_name0001.exr. handoff(Gemini): blender_export.py now produces frames/0001.exr on Blender 5.0.1.
15 hoursfix(blender_export): only write plane_distance for PLANE objectsskal
15 hoursdocs(cnn_v3): clarify --output is a base dir, not a frame_### patternskal
15 hoursdocs(cnn_v3): update HOW_TO_CNN for Blender 5.x compatibilityskal
15 hoursfix(cnn_v3): blender_export.py Blender 5.x API compatibilityskal
- compositor: use compositing_node_group (Blender 5+) / node_tree (<=4.x) - file output: use file_output_items.new(type, name) (5+) / file_slots (older) - file output: use directory attr (5+) / base_path (older) - suppress default PNG output via mkdtemp + shutil.rmtree after render - link passes by name instead of positional index - add TODO for Shadow socket name variance across blend files - clean up: extract helpers, PASS_SOCKETS constant with socket types handoff(Gemini): blender_export.py now works on Blender 5.0.1
16 hoursfix(cnn_v3): blender_export --view-layer flag + fallback to layer[0]skal
Fixes KeyError when blend file uses a non-default view layer name. Adds --view-layer NAME arg; pass '?' to list available layers. Defaults to index 0 with a clear error if the name is not found. handoff(Gemini): blender_export.py view layer selection now robust
16 hoursfeat(cnn_v3): gen_sample tool + 7 simple training samplesskal
- pack_photo_sample.py: --target now required (no albedo fallback) - gen_sample.py: bash wrapper with positional args (input target output_dir) - input/photo7.jpg: copy of photo2 (second style target) - target_1: photo2_1_out→photo2_out, photo2_2_out→photo7_out - dataset/simple/sample_001..007: 7 packed photo/target pairs handoff(Gemini): training data ready; next step is train_cnn_v3.py run
16 hoursfeat(cnn_v3): gen_sample tool + 7 simple training samplesskal
- pack_photo_sample.py: --target now required (no albedo fallback) - gen_sample.py: bash wrapper with positional args (input target output_dir) - input/photo7.jpg: copy of photo2 (second style target) - target_1: photo2_1_out→photo2_out, photo2_2_out→photo7_out - dataset/simple/sample_001..007: 7 packed photo/target pairs handoff(Gemini): training data ready; next step is train_cnn_v3.py run
16 hoursfeat(cnn_v3): gen_sample tool + 7 simple training samplesskal
- pack_photo_sample.py: --target now required (no albedo fallback) - gen_sample.py: bash wrapper with positional args (input target output_dir) - input/photo7.jpg: copy of photo2 (second style target) - target_1: photo2_1_out→photo2_out, photo2_2_out→photo7_out - dataset/simple/sample_001..007: 7 packed photo/target pairs handoff(Gemini): training data ready; next step is train_cnn_v3.py run
16 hoursfeat(cnn_v3): gen_sample tool + 7 simple training samplesskal
- pack_photo_sample.py: --target now required (no albedo fallback) - gen_sample: bash wrapper with positional args (input target output_dir) - input/photo7.jpg: copy of photo2 (second style target) - target_1: photo2_1_out→photo2_out, photo2_2_out→photo7_out - dataset/simple/sample_001..007: 7 packed photo/target pairs handoff(Gemini): training data ready; next step is train_cnn_v3.py run
34 hoursrefactor(cnn_v3): code review — comments, simplifications, test fixskal
C++: - cnn_v3_effect.cc: fix declare_nodes comment (output node declared by caller) - cnn_v3_effect.cc: add TODO(phase-7) marker for FiLM MLP replacement WGSL: - cnn_v3_bottleneck.wgsl: consolidate _pad fields onto one line, explain why array<u32,3> is invalid in uniform address space - cnn_v3_enc0.wgsl: fix "12xu8" → "12ch u8norm" in header comment - cnn_v3_dec0.wgsl: clarify parity note (sigmoid after FiLM+ReLU, not raw conv) - cnn_v3_common.wgsl: clarify unpack_8ch pack layout (low/high 16 bits) Python: - cnn_v3_utils.py: replace PIL-based _upsample_nearest (uint8 round-trip) with pure numpy index arithmetic; rename _resize_rgb → _resize_img (handles any channel count); add comment on normal zero-pad workaround - export_cnn_v3_weights.py: add cross-ref to cnn_v3_effect.cc constants; clarify weight count comments with Conv notation Test: - test_cnn_v3_parity.cc: enc0/dec1 layer failures now return 0 (were print-only) handoff(Gemini): CNN v3 review complete, 36/36 tests passing.
37 hoursfeat(cnn_v3): HTML WebGPU tool (index.html + shaders.js + tester.js)skal
3-file tool, 939 lines total. Implements full U-Net+FiLM inference in the browser: Pack→Enc0→Enc1→Bottleneck→Dec1→Dec0 compute passes, layer visualisation (Feat/Enc0/Enc1/BN/Dec1/Output), FiLM MLP sliders, drag-drop weights + image/video, Save PNG, diff/blend view modes. HOW_TO_CNN.md §7 updated to reflect tool is implemented. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 hoursfeat(cnn_v3): export script + HOW_TO_CNN.md playbookskal
- export_cnn_v3_weights.py: .pth → cnn_v3_weights.bin (f16 packed u32) + cnn_v3_film_mlp.bin (f32) - HOW_TO_CNN.md: full pipeline playbook (data collection, training, export, C++ wiring, parity, HTML tool) - TODO.md: mark export script done Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 hoursfeat(cnn_v3): Phase 6 — training script (train_cnn_v3.py + cnn_v3_utils.py)skal
- train_cnn_v3.py: CNNv3 U-Net+FiLM model, training loop, CLI - cnn_v3_utils.py: image I/O, pyrdown, depth_gradient, assemble_features, apply_channel_dropout, detect_salient_points, CNNv3Dataset - Patch-based training (default 64×64) with salient-point extraction (harris/shi-tomasi/fast/gradient/random detectors, pre-cached at init) - Channel dropout for geometric/context/temporal channels - Random FiLM conditioning per sample for joint MLP+U-Net training - docs: HOWTO.md §3 updated with commands and flag reference - TODO.md: Phase 6 marked done, export script noted as next step Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 hoursdocs(cnn_v3): update CNN_V3.md + HOWTO.md to reflect Phases 1-5 completeskal
- CNN_V3.md: status line, architecture channel counts (8/16→4/8), FiLM MLP output count (96→40 params), size budget table (real implemented values) - HOWTO.md: Phase status table (5→done, add phase 6 training TODO), sections 3-5 rewritten to reflect what exists vs what is still planned
38 hoursfeat(cnn_v3): Phase 5 complete — parity validation passing (36/36 tests)skal
- Add test_cnn_v3_parity.cc: zero_weights + random_weights tests - Add gen_test_vectors.py: PyTorch reference implementation for enc0/enc1/bn/dec1/dec0 - Add test_vectors.h: generated C header with enc0, dec1, output expected values - Fix declare_nodes(): intermediate textures at fractional resolutions (W/2, W/4) using new NodeRegistry::default_width()/default_height() getters - Add layer-by-layer readback (enc0, dec1) for regression coverage - Final parity: enc0 max_err=1.95e-3, dec1 max_err=1.95e-3, out max_err=4.88e-4 handoff(Claude): CNN v3 parity done. Next: train_cnn_v3.py (FiLM MLP training).
39 hoursdocs: session handoff — CNN v3 Phase 4 completeskal
- TODO.md: mark Phase 4 done, add FiLM MLP training details (blocked on train_cnn_v3.py), clarify what 'real' set_film_params() requires - COMPLETED.md: archive Phase 4 with alignment fix note (vec3u→64/96 bytes) handoff(Gemini): next up CNN v3 Phase 5 (parity validation) or train_cnn_v3.py
39 hoursfeat(cnn_v3): Phase 4 complete — CNNv3Effect C++ + FiLM uniform uploadskal
- cnn_v3/src/cnn_v3_effect.{h,cc}: full Effect subclass with 5 compute passes (enc0→enc1→bottleneck→dec1→dec0), shared weights storage buffer, per-pass uniform buffers, set_film_params() API - Fixed WGSL/C++ struct alignment: vec3u has align=16, so CnnV3Params4ch is 64 bytes and CnnV3ParamsEnc1 is 96 bytes (not 48/80) - Weight offsets computed as explicit formulas (e.g. 20*4*9+4) for clarity - Registered in CMake, shaders.h/cc, demo_effects.h, test_demo_effects.cc - 35/35 tests pass handoff(Gemini): CNN v3 Phase 5 next — parity validation (Python ref vs WGSL)
39 hoursfeat(cnn_v3): Phase 3 complete — WGSL U-Net inference shadersskal
5 compute shaders + cnn_v3/common snippet: enc0: Conv(20→4,3×3) + FiLM + ReLU full-res enc1: AvgPool + Conv(4→8,3×3) + FiLM + ReLU half-res bottleneck: AvgPool + Conv(8→8,1×1) + ReLU quarter-res dec1: NearestUp + cat(enc1) + Conv(16→4) + FiLM half-res dec0: NearestUp + cat(enc0) + Conv(8→4) + FiLM + Sigmoid full-res Parity rules: zero-pad conv, AvgPool down, NearestUp, FiLM after conv+bias, skip=concat, OIHW weights+bias layout. Matches PyTorch train_cnn_v3.py forward() exactly. Registered in workspaces/main/assets.txt + src/effects/shaders.cc. Weight layout + Params struct documented in cnn_v3/docs/HOWTO.md §7. Next: Phase 4 — C++ CNNv3Effect + FiLM uniform upload. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
40 hoursmake the heptagon effect more interestingskal
3 daysfeat(cnn_v3): Phase 1 complete - GBufferEffect integrated + HOWTO playbookskal
- Wire GBufferEffect into demo build: assets.txt, DemoSourceLists.cmake, demo_effects.h, shaders.h/cc. ShaderComposer::Compose() applied to gbuf_raster.wgsl (resolves #include "common_uniforms"). - Add GBufferEffect construction test. 35/35 passing. - Write cnn_v3/docs/HOWTO.md: G-buffer wiring, training data prep, training plan, per-pixel validation workflow, phase status table, troubleshooting guide. - Add project hooks: remind to update HOWTO.md on cnn_v3/ edits; warn on direct str_view(*_wgsl) usage bypassing ShaderComposer. - Update PROJECT_CONTEXT.md and TODO.md: Phase 1 done, Phase 3 (WGSL U-Net shaders) is next active. handoff(Gemini): CNN v3 Phase 3 is next - WGSL enc/dec/bottleneck/FiLM shaders in cnn_v3/shaders/. See cnn_v3/docs/CNN_V3.md Architecture section and cnn_v3/docs/HOWTO.md section 3 for spec. GBufferEffect outputs feat_tex0 + feat_tex1 (rgba32uint, 20ch, 32 bytes/pixel). C++ CNNv3Effect (Phase 4) takes those as input nodes.
3 daysfeat(cnn_v3): G-buffer phase 1 + training infrastructureskal
G-buffer (Phase 1): - Add NodeTypes GBUF_ALBEDO/DEPTH32/R8/RGBA32UINT to NodeRegistry - GBufferEffect: MRT raster pass (albedo+normal_mat+depth) + pack compute - Shaders: gbuf_raster.wgsl (MRT), gbuf_pack.wgsl (feature packing, 32B/px) - Shadow/SDF passes stubbed (placeholder textures), CMake integration deferred Training infrastructure (Phase 2): - blender_export.py: headless EXR export with all G-buffer render passes - pack_blender_sample.py: EXR → per-channel PNGs (oct-normals, 1/z depth) - pack_photo_sample.py: photo → zero-filled G-buffer sample layout handoff(Gemini): G-buffer phases 3-5 remain (U-Net shaders, CNNv3Effect, parity)
3 daysdocs(cnn_v3): full design doc — U-Net + FiLM architecture planskal
- CNN_V3.md: complete design document - U-Net enc_channels=[4,8], ~5 KB f16 weights - FiLM conditioning (5D → γ/β per level, CPU-side MLP) - 20-channel feature buffer, 32 bytes/pixel: two rgba32uint textures - feat_tex0: albedo.rgb, normal.xy, depth, depth_grad.xy (f16) - feat_tex1: mat_id, prev.rgb, mip1.rgb, mip2.rgb, shadow, transp (u8) - 4-pass G-buffer: raster MRT + SDF compute + lighting + pack - Per-pixel parity framework: PyTorch / HTML WebGPU / C++ WebGPU (≤1/255) - Training pipelines: Blender full G-buffer + photo-only (channel dropout) - train_cnn_v3_full.sh spec (modelled on v2 script) - HTML tool adaptation plan from cnn_v2/tools/cnn_v2_test/index.html - Binary format v3 header spec - 8-phase ordered implementation checklist - TODO.md: add CNN v3 U-Net+FiLM future task with phases - cnn_v3/README.md: update status to design phase handoff(Gemini): CNN v3 design complete. Phase 0 (stub G-buffer) unblocks all other phases — one compute shader writing feat_tex0+feat_tex1 with synthetic values from the current framebuffer. See cnn_v3/docs/CNN_V3.md Implementation Checklist.
3 daysdocs: archive stale/completed docs, compact active refs (-1300 lines)skal
- Archive WORKSPACE_SYSTEM.md (completed); replace with 36-line operational ref - Archive SHADER_REUSE_INVESTIGATION.md (implemented Feb 2026) - Archive GPU_PROCEDURAL_PHASE4.md (completed feature) - Archive GEOM_BUFFER.md (ideation only, never implemented) - Archive SPECTRAL_BRUSH_EDITOR.md (v1 DCT approach, superseded by MQ v2) - Update CLAUDE.md Tier 3 refs; point Audio to SPECTRAL_BRUSH_2.md - Update TODO.md Task #5 design link to SPECTRAL_BRUSH_2.md - Update COMPLETED.md archive index handoff(Claude): doc cleanup done, 30 active docs (was 34), -1300 lines
3 dayschore: remove broken seeking test, demote CNN v2 quant to future CNN v3skal
handoff(Gemini): removed test_audio_engine_seeking (broken, not worth fixing); moved CNN v2 8-bit quantization to Future as CNN v3 task.
3 daysadd a commit ruleskal
3 daysdocs(init): add glfw as macOS brew dependencyskal
project_init.sh now checks/installs both wgpu-native and glfw via brew. HOWTO.md documents the macOS prerequisites before the build steps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 daysfix(assets): skip missing binary assets with warning instead of failingskal
asset_packer now emits a zero-size empty stub for BINARY assets whose file is not found, and continues with a warning rather than aborting. Allows building without optional assets like cnn_v2_weights.bin. handoff(Gemini): asset_packer tolerates missing BINARY files; GetAsset() returns nullptr/size=0 for those assets at runtime. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 daysfix(win): accept SuccessSuboptimal in surface texture status checkskal
Wine/Vulkan returns WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal instead of SuccessOptimal, causing the blit pass to be skipped entirely and the window to stay black. Fixed in seq_compiler.py (the source template); regenerated timeline.cc. Tests: 35/35. handoff(Gemini): Wine black screen fixed — root cause was status code check rejecting suboptimal swapchain; exe now renders on Wine. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 daysfix(build): move generated assets to per-build binary dirskal
assets_data.cc was shared in src/generated/ across all builds. When a native debug build regenerated it with --disk_load (file paths), then build_win compiled with STRIP_ALL=ON, the disk-load fopen() path was compiled out, leaving raw macOS paths as shader source content — causing wgpu WGSL parse errors on Wine. Fix: GEN_DEMO_H/CC and all stamps now live in CMAKE_CURRENT_BINARY_DIR/ src/generated/ so each build dir independently generates assets in the correct mode (embedded vs disk-load). Added CMAKE_CURRENT_BINARY_DIR/src to CORE_INCLUDES so the binary-dir assets.h is resolved first. handoff(Gemini): build system fix — assets are now per-build-dir; tests 35/35 pass; build_win produces embedded shaders. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 daysfix(assets): regenerate assets when DEMO_STRIP_ALL togglesskal
Write asset_packer_mode.flag at configure time so that switching between disk-load (debug) and embedded (STRIP_ALL) modes invalidates assets_data.cc. Previously a stale embedded assets_data.cc caused fopen() on WGSL bytes, silently failing all shader snippet registration (vs_main not found crash). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 daysdocs(todo): add Wine black screen investigation taskskal
demo64k.exe runs under Wine but renders no visuals. Audio/timeline work. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 daysfix(win): update wgpu-native to v27, unify Windows/macOS API pathsskal
- 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 <noreply@anthropic.com>
12 daysfix(headless): add missing sampler/texture stubs to gpu_headless.ccskal
gpu_create_linear_sampler, gpu_create_nearest_sampler, and gpu_create_dummy_scene_texture were defined only in gpu.cc, causing link errors in DEMO_HEADLESS mode. handoff(Gemini): headless mode link error fixed, 35/35 tests should still pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfix(test_3d): correct projection matrix m[5] assertion signskal
m[5] = -1/tan(fov/2); larger FOV yields smaller magnitude (closer to 0), so proj_varied.m[5] > proj.m[5], not <. handoff(Gemini): fixed ThreeDSystemTest assertion in test_3d.cc:43 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfactorize render_ntsc()skal
12 daysfix(effects): particle sync and heptagon SDF bugsskal
- particles: stagger respawn y by golden-ratio index offset to break per-row synchronization (100 particles per row fell in lock-step) - heptagon: fix swapped atan2(x,y)->atan2(y,x) and WGSL % truncation for negative angles (broke SDF for entire lower half of shape) handoff(Gemini): heptagon now correct; particles desynchronized Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfix(particles): release compute and render pass encodersskal
Missing wgpuComputePassEncoderRelease/wgpuRenderPassEncoderRelease caused per-frame leaks and command buffer corruption in wgpu-native. handoff(Gemini): particles encoder leak fixed, 2 lines added to render() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 dayschange dither_c64() signature to take 'dimension' directlyskal
12 daysdocs: document CLASS_TO_HEADER override in EFFECT_WORKFLOWskal
12 daysfix(seq_compiler): map NtscYiq to ntsc_effect.hskal
Add CLASS_TO_HEADER override map for classes that share a header file. NtscYiq lives in ntsc_effect.h alongside Ntsc. handoff(Gemini): seq_compiler.py fix for shared-header effect classes.
12 daysntsc: factor common code into snippet; add RGB and YIQ input variantsskal
- Extract shared NTSC logic into render/ntsc_common.wgsl snippet - sample_ntsc_signal() hook decouples input format from processing - ntsc_rgb.wgsl: RGB input (converts via rgba_to_luma_chroma_phase) - ntsc_yiq.wgsl: YIQ passthrough for RotatingCube output - Add NtscYiq WgslEffect thin wrapper; register both in tests handoff(Claude): NTSC refactor complete; NtscYiq ready for timeline use with RotatingCube. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 daysrotating_cube: use VSOut, and store to yiqskal
13 daysfix: use ShaderComposer in RotatingCube; add rule to CODING_STYLEskal
rotating_cube_effect.cc was bypassing ShaderComposer, causing #include directives in rotating_cube.wgsl to fail at runtime. handoff(Claude): ShaderComposer rule documented and enforced in rotating_cube. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 daysstyle: require 2-line header comment in all .wgsl filesskal
Add rule to CODING_STYLE.md and apply to ntsc.wgsl. handoff(Claude): rule added, ntsc.wgsl patched; scratch_lines and color_c64 already compliant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 daysNTSC: use 6-taps filtering instead of 12-tapskal
14 daysdocs: streamline SEQUENCE.md (12 effects, remove v1 migration notes)skal
handoff(Gemini): SEQUENCE.md updated - removed obsolete v1 migration notes, updated effect count 7→12, added absolute-time note, removed completed TODO items. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 daysdocs: update PROJECT_CONTEXT with new color/color_c64 snippets (27 shaders)skal
14 daysrefactor: mv get_border_col() to color_c64.wgsl as get_border_c64()skal