Repository navigation
Add CUDA WebShader browser encoder and integrated viewer - #1
Draft
SamG-Coder wants to merge 2 commits into
Draft
SamG-Coder wants to merge 2 commits into
SamG-Coder wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a browser encoder at webgpu/encode.html that runs CUDA device kernels through CUDA WebShader and hands exported assets directly to the existing WebGPU viewer. Users can select one to six material maps, fit one-to-four-channel latent planes, compare reconstructions, and download the standard NNTC JSON plus DDS files as a ZIP.
The GPU path covers filtered observation generation, streamed decoder normal equations, four-color latent coordinate descent and reconstruction. Host code handles source mip/PCA initialization, small dense solves, quantization/BC packing and file I/O. The CUDA WebShader submodule pins 896432c, which adds the reusable fitting operation in SamG-Coder/cuda-webshader#2.
Scope: this is a format-compatible browser implementation, not native encoder parity. It uses f32 GPU accumulation and a different optimizer, and does not port all native material options, global sparse solves or decoder-objective BC refinement. The native implementation remains available. docs/BROWSER_ENCODER.md explains supported features and numerical differences.
Validation:
Run: git submodule update --init --recursive; npm ci; npm start. Open http://127.0.0.1:5174.