Skip to content

Fix packed covSplats accumulator throwing "Generator must be provided" - #471

Open
jesusluque wants to merge 2 commits into
sparkjsdev:mainfrom
jesusluque:fix-packed-cov-accumulator
Open

jesusluque wants to merge 2 commits into
sparkjsdev:mainfrom
jesusluque:fix-packed-cov-accumulator

Conversation

@jesusluque

Copy link
Copy Markdown

With covSplats: true and the packed accumulator (no accumExtSplats), SplatAccumulator throws "Generator must be provided" for every covariance generator.

After the packed covariance branch, which already handles a covGenerator on its own, a leftover check still required a GsplatGenerator. This PR removes it. Packed covariance splats now generate like the ext ones.

Test: test/unit/SplatAccumulator.test.ts builds the packed covariance accumulator for a covariance-only generator. It fails before the fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JtbHkmUpoNeo1EwbHiLihG

…ded"

With covSplats and without extSplats, a stray check after the packed
covariance branch required a GsplatGenerator, so a covGenerator alone
(which that branch already handles) always threw. Remove it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JtbHkmUpoNeo1EwbHiLihG
Comment thread test/unit/SplatAccumulator.test.ts Outdated
Comment on lines +8 to +15
return dynoBlock({ index: "int" }, { covsplat: CovSplat }, () => ({
covsplat: new Dyno({
outTypes: { covsplat: CovSplat },
statements: ({ outputs }) => [
`${outputs.covsplat}.flags = GSPLAT_FLAG_ACTIVE;`,
],
}).outputs.covsplat,
}));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the context of this test, it only needs to have the right shape, so giving the inTypes and outTypes without actually constructing anything suffices:

Suggested change
return dynoBlock({ index: "int" }, { covsplat: CovSplat }, () => ({
covsplat: new Dyno({
outTypes: { covsplat: CovSplat },
statements: ({ outputs }) => [
`${outputs.covsplat}.flags = GSPLAT_FLAG_ACTIVE;`,
],
}).outputs.covsplat,
}));
return dynoBlock({ index: "int" }, { covsplat: CovSplat }, () => ({}));

Comment thread test/unit/SplatAccumulator.test.ts Outdated
Comment on lines +18 to +20
// The packed covariance accumulator (covSplats without extSplats) builds its
// program from a covGenerator alone, as the extended one does.
test("packed covSplats accumulator accepts a covGenerator alone", () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description and accompanying comment focus on the "packed" case, yet effectively test both. Could make it a parametrized test (test.each) and generically test that the accumulator accepts just a covGenerator if covSplats is true.

@oscarlorentzon

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. The fix looks good.

Would you be able to apply @mrxz's two suggestions on the test, or would you prefer that we take over the PR?

@jesusluque

Copy link
Copy Markdown
Author

As you wish! Feel free to take over the PR. Thanks!

The test ran the packed and the extended accumulator inside one case
named after the packed one. Each mode is now its own case, and the
generator declares only its input and output types.
@oscarlorentzon

Copy link
Copy Markdown
Collaborator

Took this over as discussed, thanks @jesusluque.

Applied @mrxz's two suggestions on the test.

@oscarlorentzon

Copy link
Copy Markdown
Collaborator

@dmarcos This should be ready to merge.

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.

3 participants