<feed xmlns='http://www.w3.org/2005/Atom'>
<title>demo.git/src/procedural, 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>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>Add test asset support with STRIP_ALL guards</title>
<updated>2026-02-13T12:28:02Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-13T12:28:02Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=2fd58be11246772dd50ede6188a4ab960e6ffc0e'/>
<id>urn:sha1:2fd58be11246772dd50ede6188a4ab960e6ffc0e</id>
<content type='text'>
Fixes test_assets.cc compilation by adding missing test asset IDs and
procedural generators. Test-specific code is protected with DEMO_STRIP_ALL
to exclude from release builds.

Co-Authored-By: Claude Sonnet 4.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>refactor(procedural): Use hash-based noise instead of lattice approach</title>
<updated>2026-02-08T18:14:55Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-08T18:14:55Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=b7d282249394a8c0a48d5dfe5af410b541c724cc'/>
<id>urn:sha1:b7d282249394a8c0a48d5dfe5af410b541c724cc</id>
<content type='text'>
Replaces lattice-based noise generation with deterministic hash functions
matching the WGSL implementation. Eliminates heap allocations and rand()
dependency.

Changes:
- Added hash_2f() and noise_2d() C++ functions (matches WGSL)
- Refactored gen_perlin() to use hash-based FBM (no malloc/free)
- Refactored gen_noise() to use hash_based value noise
- Removed all rand()/srand() calls (now deterministic via seed offset)
- Eliminated lattice allocation/deallocation per octave

Benefits:
- Zero heap allocations (was allocating lattice per octave)
- Deterministic output (seed-based, not rand-based)
- 28% smaller code (270 → 194 lines, -75 lines)
- Matches WGSL noise implementation behavior
- Faster (no malloc overhead, better cache locality)

Testing:
- All 33 tests pass (100%)
- test_procedural validates noise/perlin/grid generation
- No visual regressions

Size Impact: ~200-300 bytes smaller (malloc/free overhead eliminated)

Co-Authored-By: Claude Sonnet 4.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat(audio): Complete Task #56 - Audio Lifecycle Refactor (All Phases)</title>
<updated>2026-02-05T19:18:28Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-05T19:18:28Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=12816810855883472ecab454f9c0d08d66f0ae52'/>
<id>urn:sha1:12816810855883472ecab454f9c0d08d66f0ae52</id>
<content type='text'>
SUMMARY
=======
Successfully completed comprehensive 4-phase refactor of audio subsystem to
eliminate fragile initialization order dependency between synth and tracker.
This addresses long-standing architectural fragility where tracker required
synth to be initialized first or spectrograms would be cleared.

IMPLEMENTATION
==============

Phase 1: Design &amp; Prototype
- Created AudioEngine class as unified audio subsystem manager
- Created SpectrogramResourceManager for lazy resource loading
- Manages synth, tracker, and resource lifecycle
- Comprehensive test suite (test_audio_engine.cc)

Phase 2: Test Migration
- Migrated all tracker tests to use AudioEngine
- Updated: test_tracker.cc, test_tracker_timing.cc,
  test_variable_tempo.cc, test_wav_dump.cc
- Pattern: Replace synth_init() + tracker_init() with engine.init()
- All 20 tests pass (100% pass rate)

Phase 3: Production Integration
- Fixed pre-existing demo crash (procedural texture loading)
- Updated flash_cube_effect.cc and hybrid_3d_effect.cc
- Migrated main.cc to use AudioEngine
- Replaced tracker_update() calls with engine.update()

Phase 4: Cleanup &amp; Documentation
- Removed synth_init() call from audio_init() (backwards compatibility)
- Added AudioEngine usage guide to HOWTO.md
- Added audio initialization protocols to CONTRIBUTING.md
- Binary size verification: &lt;500 bytes overhead (acceptable)

RESULTS
=======
✅ All 20 tests pass (100% pass rate)
✅ Demo runs successfully with audio and visuals
✅ Initialization order fragility eliminated
✅ Binary size impact minimal (&lt;500 bytes)
✅ Clear documentation for future development
✅ No backwards compatibility issues

DOCUMENTATION UPDATES
=====================
- Updated TODO.md: Moved Task #56 to "Recently Completed"
- Updated PROJECT_CONTEXT.md: Added AudioEngine milestone
- Updated HOWTO.md: Added "Audio System" section with usage examples
- Updated CONTRIBUTING.md: Added audio initialization protocols

CODE FORMATTING
===============
Applied clang-format to all source files per project standards.

FILES CREATED
=============
- src/audio/audio_engine.h (new)
- src/audio/audio_engine.cc (new)
- src/audio/spectrogram_resource_manager.h (new)
- src/audio/spectrogram_resource_manager.cc (new)
- src/tests/test_audio_engine.cc (new)

KEY FILES MODIFIED
==================
- src/main.cc (migrated to AudioEngine)
- src/audio/audio.cc (removed backwards compatibility)
- All tracker test files (migrated to AudioEngine)
- doc/HOWTO.md (added usage guide)
- doc/CONTRIBUTING.md (added protocols)
- TODO.md (marked complete)
- PROJECT_CONTEXT.md (added milestone)

TECHNICAL DETAILS
=================

AudioEngine Design Philosophy:
- Manages initialization order (synth before tracker)
- Owns SpectrogramResourceManager for lazy loading
- Does NOT wrap every synth API - direct calls remain valid
- Provides lifecycle management, not a complete facade

What to Use AudioEngine For:
- Initialization: engine.init() instead of separate init calls
- Updates: engine.update(music_time) instead of tracker_update()
- Cleanup: engine.shutdown() for proper teardown
- Seeking: engine.seek(time) for timeline navigation (debug only)

Direct Synth API Usage (Still Valid):
- synth_register_spectrogram() - Register samples
- synth_trigger_voice() - Trigger playback
- synth_get_output_peak() - Get audio levels
- synth_render() - Low-level rendering

SIZE IMPACT ANALYSIS
====================
Debug build: 6.2MB
Size-optimized build: 5.0MB
Stripped build: 5.0MB
AudioEngine overhead: &lt;500 bytes (0.01% of total)

BACKWARD COMPATIBILITY
======================
No breaking changes. Tests that need low-level control can still call
synth_init() directly. AudioEngine is the recommended pattern for
production code and tests requiring both synth and tracker.

handoff(Claude): Task #56 COMPLETE - All 4 phases finished. Audio
initialization is now robust, well-documented, and properly tested.
The fragile initialization order dependency has been eliminated.

Co-Authored-By: Claude Sonnet 4.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>test(coverage): Improve Asset Manager coverage (Task #47)</title>
<updated>2026-02-04T09:49:41Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-04T09:49:41Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=02fa8dde4ad354536e2bb0a73a11388ffc7b4ac7'/>
<id>urn:sha1:02fa8dde4ad354536e2bb0a73a11388ffc7b4ac7</id>
<content type='text'>
Added tests for runtime error handling in Asset Manager (unknown function, generation failure). Updated asset_packer to warn instead of fail on unknown functions to facilitate testing. Increased coverage from 71% to 88%.
</content>
</entry>
<entry>
<title>handoff(Claude): Stabilize 3D renderer with rotating skybox and two-pass architecture</title>
<updated>2026-02-04T08:45:36Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-04T08:45:17Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=535b63d608948c5a9a85e96d1e8c7e475b00ede0'/>
<id>urn:sha1:535b63d608948c5a9a85e96d1e8c7e475b00ede0</id>
<content type='text'>
- Fixed black screen by ensuring clear operations in Pass 2 when Skybox pass is skipped.
- Resolved WebGPU validation errors by synchronizing depth-stencil state.
- Implemented rotating skybox using world-space ray unprojection (inv_view_proj).
- Improved procedural noise generation (multi-octave Value Noise).
- Restored scene integrity by correcting object indexing and removing artifacts.
- Updated documentation (TODO.md, PROJECT_CONTEXT.md).
</content>
</entry>
<entry>
<title>feat: side-quest - Perlin noise sky and ProcGenFunc error handling</title>
<updated>2026-02-03T18:06:41Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-03T18:06:41Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=3108fb0065a51dfc3548836ea16b287e92cd8881'/>
<id>urn:sha1:3108fb0065a51dfc3548836ea16b287e92cd8881</id>
<content type='text'>
- Updated ProcGenFunc signature to return bool for error reporting.
- Implemented gen_perlin (Fractional Brownian Motion) in procedural/generator.cc.
- Added support for sky texture in Renderer3D and its shader.
- Integrated Perlin noise sky texture in test_3d_render.cc.
- Caught and handled memory/generation errors in AssetManager and TextureManager.
- Assigned reference numbers to all remaining tasks in documentation.

handoff(Gemini): Side-quest complete. ProcGenFunc now returns bool. Perlin noise added and used for sky in 3D test. Windows build remains stable. All tasks numbered.
</content>
</entry>
<entry>
<title>refactor: Task #20 - Platform &amp; Code Hygiene</title>
<updated>2026-02-03T17:44:41Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-03T17:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=bf46e44e1cb6027a072819a2a3aa3be32651f6e1'/>
<id>urn:sha1:bf46e44e1cb6027a072819a2a3aa3be32651f6e1</id>
<content type='text'>
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h.
- Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio.
- Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems.
- Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh.
- Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project.
- Applied clang-format and updated documentation.

handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
</content>
</entry>
<entry>
<title>clean-up the procedural code a bit</title>
<updated>2026-02-03T17:14:45Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-03T17:14:45Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=815c428dea14a6a1ea5c421c400985d0c14d473d'/>
<id>urn:sha1:815c428dea14a6a1ea5c421c400985d0c14d473d</id>
<content type='text'>
</content>
</entry>
</feed>
