Skip to content

feat: add neural rendering subsystem (NTC, radiance cache, neural pos…#379

Merged
Krilliac merged 6 commits into
Workingfrom
claude/neural-texture-compression-Ik2jo
Apr 5, 2026
Merged

feat: add neural rendering subsystem (NTC, radiance cache, neural pos…#379
Krilliac merged 6 commits into
Workingfrom
claude/neural-texture-compression-Ik2jo

Conversation

@Krilliac

@Krilliac Krilliac commented Apr 5, 2026

Copy link
Copy Markdown
Owner

…t-processing)

Implements a lightweight GPU neural inference engine and three neural rendering features built on top of it:

  • Neural Inference Engine: compute shader-based MLP evaluator with CPU fallback, no external ML framework dependency
  • Neural Texture Compression (NTC): per-block MLP encoding of textures with .ntex file format, CPU training, GPU/CPU decompression
  • Neural Radiance Cache: multi-resolution hash grid + MLP for cached indirect lighting (Instant NGP-inspired)
  • Neural Post-Processing: neural denoiser (IDenoiser backend) and neural super-resolution enhancement for SparkSR

All systems integrate with existing engine infrastructure:

  • TextureCompressor: added Neural format variant
  • DenoiserInterface: added Neural backend enum
  • UpscalingSettings: added neuralEnhancement flag
  • EngineContext: NeuralInferenceEngine registered at startup
  • CMake: ENABLE_NEURAL_RENDERING toggle (ON by default)

22 new files (~4000 lines), 6 HLSL compute shaders, 4 test files with 40+ tests. All 3714 tests pass.

https://claude.ai/code/session_01TS53MsdxLYbFPpiGkEQmoR

…t-processing)

Implements a lightweight GPU neural inference engine and three neural
rendering features built on top of it:

- Neural Inference Engine: compute shader-based MLP evaluator with CPU
  fallback, no external ML framework dependency
- Neural Texture Compression (NTC): per-block MLP encoding of textures
  with .ntex file format, CPU training, GPU/CPU decompression
- Neural Radiance Cache: multi-resolution hash grid + MLP for cached
  indirect lighting (Instant NGP-inspired)
- Neural Post-Processing: neural denoiser (IDenoiser backend) and
  neural super-resolution enhancement for SparkSR

All systems integrate with existing engine infrastructure:
- TextureCompressor: added Neural format variant
- DenoiserInterface: added Neural backend enum
- UpscalingSettings: added neuralEnhancement flag
- EngineContext: NeuralInferenceEngine registered at startup
- CMake: ENABLE_NEURAL_RENDERING toggle (ON by default)

22 new files (~4000 lines), 6 HLSL compute shaders, 4 test files
with 40+ tests. All 3714 tests pass.

https://claude.ai/code/session_01TS53MsdxLYbFPpiGkEQmoR
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage (GCC + lcov)

Utils/Logger.h                                 |18.2%   121| 0.0%  20|    -    0
Utils/MathUtils.cpp                            |    -     0|    -   0|    -    0
Utils/MemoryDebugger.h                         |13.3%   150| 0.0%  20|    -    0
Utils/MemoryMonitor.cpp                        | 9.6%   229| 0.0%  19|    -    0
Utils/MemoryMonitor.h                          |85.7%    14| 0.0%  12|    -    0
Utils/NetworkHealthMonitor.cpp                 | 113%    15| 0.0%   2|    -    0
Utils/NetworkHealthMonitor.h                   |    -     0|    -   0|    -    0
Utils/OpaqueHandle.h                           | 209%    11| 0.0%  15|    -    0
Utils/Profiler.cpp                             |14.2%   113| 0.0%  15|    -    0
Utils/Profiler.h                               |36.4%    33| 0.0%  12|    -    0
Utils/RandomEngine.h                           |29.3%    41| 0.0%  12|    -    0
Utils/Result.h                                 | 100%    29| 0.0%  28|    -    0
Utils/RingBuffer.h                             | 108%    59| 0.0%  64|    -    0
Utils/ScopeGuard.h                             | 142%    36| 0.0%  51|    -    0
Utils/ScopedTimer.h                            |25.0%    12| 0.0%   3|    -    0
Utils/Serializer.h                             | 100%    48| 0.0%  42|    -    0
Utils/SparkConsole.cpp                         |93.2%    44| 0.0%   7|    -    0
Utils/SparkConsole.h                           | 100%     2| 0.0%   2|    -    0
Utils/SparkError.h                             |10.9%    55| 0.0%   6|    -    0
Utils/SplinePath.h                             |    -     0|    -   0|    -    0
Utils/StackTrace.h                             |11.0%    73| 0.0%   8|    -    0
Utils/StateMachine.h                           |54.0%    63| 0.0%  32|    -    0
Utils/StringUtils.h                            |18.8%   112| 0.0%  21|    -    0
Utils/Telemetry.h                              |21.8%    87| 0.0%  16|    -    0
Utils/ThreadDebugger.h                         |12.8%   148| 0.0%  19|    -    0
Utils/ThreadSafeQueue.h                        |27.5%    40| 0.0%  11|    -    0
Utils/UUID.h                                   |43.2%    37| 0.0%  16|    -    0
Utils/Validate.h                               |    -     0|    -   0|    -    0

[/home/runner/work/SparkEngine/SparkEngine/SparkSDK/Include/Spark/]
IEngineContext.h                               |6700%     1| 0.0%   1|    -    0
Version.h                                      |    -     0|    -   0|    -    0
================================================================================
                                         Total:|31.2% 15674| 0.0%  2k|    -    0

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

✅ CI Errors Resolved

All previously reported errors have been fixed. All builds passing.

Last checked: 2026-04-05T08:41:30Z

MSVC doesn't transitively include <algorithm> unlike GCC/Clang, causing
a build failure on Windows CI.

https://claude.ai/code/session_01TS53MsdxLYbFPpiGkEQmoR
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage (GCC + lcov)

Utils/Logger.h                                 |18.2%   121| 0.0%  20|    -    0
Utils/MathUtils.cpp                            |    -     0|    -   0|    -    0
Utils/MemoryDebugger.h                         |13.3%   150| 0.0%  20|    -    0
Utils/MemoryMonitor.cpp                        | 9.6%   229| 0.0%  19|    -    0
Utils/MemoryMonitor.h                          |85.7%    14| 0.0%  12|    -    0
Utils/NetworkHealthMonitor.cpp                 | 113%    15| 0.0%   2|    -    0
Utils/NetworkHealthMonitor.h                   |    -     0|    -   0|    -    0
Utils/OpaqueHandle.h                           | 209%    11| 0.0%  15|    -    0
Utils/Profiler.cpp                             |14.2%   113| 0.0%  15|    -    0
Utils/Profiler.h                               |36.4%    33| 0.0%  12|    -    0
Utils/RandomEngine.h                           |29.3%    41| 0.0%  12|    -    0
Utils/Result.h                                 | 100%    29| 0.0%  28|    -    0
Utils/RingBuffer.h                             | 108%    59| 0.0%  64|    -    0
Utils/ScopeGuard.h                             | 142%    36| 0.0%  51|    -    0
Utils/ScopedTimer.h                            |25.0%    12| 0.0%   3|    -    0
Utils/Serializer.h                             | 100%    48| 0.0%  42|    -    0
Utils/SparkConsole.cpp                         |93.2%    44| 0.0%   7|    -    0
Utils/SparkConsole.h                           | 100%     2| 0.0%   2|    -    0
Utils/SparkError.h                             |10.9%    55| 0.0%   6|    -    0
Utils/SplinePath.h                             |    -     0|    -   0|    -    0
Utils/StackTrace.h                             |11.0%    73| 0.0%   8|    -    0
Utils/StateMachine.h                           |54.0%    63| 0.0%  32|    -    0
Utils/StringUtils.h                            |18.8%   112| 0.0%  21|    -    0
Utils/Telemetry.h                              |21.8%    87| 0.0%  16|    -    0
Utils/ThreadDebugger.h                         |12.8%   148| 0.0%  19|    -    0
Utils/ThreadSafeQueue.h                        |27.5%    40| 0.0%  11|    -    0
Utils/UUID.h                                   |43.2%    37| 0.0%  16|    -    0
Utils/Validate.h                               |    -     0|    -   0|    -    0

[/home/runner/work/SparkEngine/SparkEngine/SparkSDK/Include/Spark/]
IEngineContext.h                               |6700%     1| 0.0%   1|    -    0
Version.h                                      |    -     0|    -   0|    -    0
================================================================================
                                         Total:|31.2% 15674| 0.0%  2k|    -    0

claude and others added 3 commits April 5, 2026 07:27
Replace naive scalar CPU fallback in NeuralInferenceEngine with
SSE2/AVX2-accelerated MLP forward pass via MultiISA dispatch pattern.
Large batches (>=16 samples) auto-parallelize across JobSystem workers.

- New CpuNeuralInference class: SIMD layer eval, weight padding, batch dispatch
- NeuralInferenceEngine.EvaluateCPU now delegates to SIMD path
- NeuralPostProcessing: batch all patch pixels in single inference call
- NeuralRadianceCache: batch all queries in single inference call
- 14 new tests covering SIMD correctness, batching, and reference matching

https://claude.ai/code/session_01CVmfPaczLYeyZNiCqsvh82
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage (GCC + lcov)

Utils/MathUtils.cpp                            |    -     0|    -   0|    -    0
Utils/MemoryDebugger.h                         |13.3%   150| 0.0%  20|    -    0
Utils/MemoryMonitor.cpp                        | 9.6%   229| 0.0%  19|    -    0
Utils/MemoryMonitor.h                          |85.7%    14| 0.0%  12|    -    0
Utils/MultiISA.h                               |42.9%    14| 0.0%   6|    -    0
Utils/NetworkHealthMonitor.cpp                 | 113%    15| 0.0%   2|    -    0
Utils/NetworkHealthMonitor.h                   |    -     0|    -   0|    -    0
Utils/OpaqueHandle.h                           | 209%    11| 0.0%  15|    -    0
Utils/Profiler.cpp                             |14.2%   113| 0.0%  15|    -    0
Utils/Profiler.h                               |36.4%    33| 0.0%  12|    -    0
Utils/RandomEngine.h                           |29.3%    41| 0.0%  12|    -    0
Utils/Result.h                                 | 100%    29| 0.0%  28|    -    0
Utils/RingBuffer.h                             | 108%    59| 0.0%  64|    -    0
Utils/ScopeGuard.h                             | 142%    36| 0.0%  51|    -    0
Utils/ScopedTimer.h                            |25.0%    12| 0.0%   3|    -    0
Utils/Serializer.h                             | 100%    48| 0.0%  42|    -    0
Utils/SparkConsole.cpp                         |93.2%    44| 0.0%   7|    -    0
Utils/SparkConsole.h                           | 100%     2| 0.0%   2|    -    0
Utils/SparkError.h                             |10.9%    55| 0.0%   6|    -    0
Utils/SplinePath.h                             |    -     0|    -   0|    -    0
Utils/StackTrace.h                             |11.0%    73| 0.0%   8|    -    0
Utils/StateMachine.h                           |54.0%    63| 0.0%  32|    -    0
Utils/StringUtils.h                            |18.8%   112| 0.0%  21|    -    0
Utils/Telemetry.h                              |21.8%    87| 0.0%  16|    -    0
Utils/ThreadDebugger.h                         |12.8%   148| 0.0%  19|    -    0
Utils/ThreadSafeQueue.h                        |27.5%    40| 0.0%  11|    -    0
Utils/UUID.h                                   |43.2%    37| 0.0%  16|    -    0
Utils/Validate.h                               |    -     0|    -   0|    -    0

[/home/runner/work/SparkEngine/SparkEngine/SparkSDK/Include/Spark/]
IEngineContext.h                               |6700%     1| 0.0%   1|    -    0
Version.h                                      |    -     0|    -   0|    -    0
================================================================================
                                         Total:|31.2% 15781| 0.0%  2k|    -    0

- Fix extra whitespace in DynamicQualityTypes.h neuralEnhancement field
- Replace hardcoded /tmp/ paths with std::filesystem::temp_directory_path()
  in neural test files (fixes ACCESS_VIOLATION on Windows CI)

https://claude.ai/code/session_01TS53MsdxLYbFPpiGkEQmoR
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage (GCC + lcov)

Utils/MathUtils.cpp                            |    -     0|    -   0|    -    0
Utils/MemoryDebugger.h                         |13.3%   150| 0.0%  20|    -    0
Utils/MemoryMonitor.cpp                        | 9.6%   229| 0.0%  19|    -    0
Utils/MemoryMonitor.h                          |85.7%    14| 0.0%  12|    -    0
Utils/MultiISA.h                               |42.9%    14| 0.0%   6|    -    0
Utils/NetworkHealthMonitor.cpp                 | 113%    15| 0.0%   2|    -    0
Utils/NetworkHealthMonitor.h                   |    -     0|    -   0|    -    0
Utils/OpaqueHandle.h                           | 209%    11| 0.0%  15|    -    0
Utils/Profiler.cpp                             |14.2%   113| 0.0%  15|    -    0
Utils/Profiler.h                               |36.4%    33| 0.0%  12|    -    0
Utils/RandomEngine.h                           |29.3%    41| 0.0%  12|    -    0
Utils/Result.h                                 | 100%    29| 0.0%  28|    -    0
Utils/RingBuffer.h                             | 108%    59| 0.0%  64|    -    0
Utils/ScopeGuard.h                             | 142%    36| 0.0%  51|    -    0
Utils/ScopedTimer.h                            |25.0%    12| 0.0%   3|    -    0
Utils/Serializer.h                             | 100%    48| 0.0%  42|    -    0
Utils/SparkConsole.cpp                         |93.2%    44| 0.0%   7|    -    0
Utils/SparkConsole.h                           | 100%     2| 0.0%   2|    -    0
Utils/SparkError.h                             |10.9%    55| 0.0%   6|    -    0
Utils/SplinePath.h                             |    -     0|    -   0|    -    0
Utils/StackTrace.h                             |11.0%    73| 0.0%   8|    -    0
Utils/StateMachine.h                           |54.0%    63| 0.0%  32|    -    0
Utils/StringUtils.h                            |18.8%   112| 0.0%  21|    -    0
Utils/Telemetry.h                              |21.8%    87| 0.0%  16|    -    0
Utils/ThreadDebugger.h                         |12.8%   148| 0.0%  19|    -    0
Utils/ThreadSafeQueue.h                        |27.5%    40| 0.0%  11|    -    0
Utils/UUID.h                                   |43.2%    37| 0.0%  16|    -    0
Utils/Validate.h                               |    -     0|    -   0|    -    0

[/home/runner/work/SparkEngine/SparkEngine/SparkSDK/Include/Spark/]
IEngineContext.h                               |6700%     1| 0.0%   1|    -    0
Version.h                                      |    -     0|    -   0|    -    0
================================================================================
                                         Total:|31.2% 15781| 0.0%  2k|    -    0

@Krilliac
Krilliac merged commit 7e92ba0 into Working Apr 5, 2026
42 checks passed
@Krilliac
Krilliac deleted the claude/neural-texture-compression-Ik2jo branch April 5, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants