Skip to content

Conversation

cieplypolar
Copy link
Collaborator

@cieplypolar cieplypolar commented Sep 9, 2025

Changes:

  • added LCG generator
  • refactored executor in probability example

Copy link

github-actions bot commented Sep 9, 2025

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@54af90b30eb48f3306844640a253a85942d372c8
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@54af90b30eb48f3306844640a253a85942d372c8
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@54af90b30eb48f3306844640a253a85942d372c8

benchmark
view benchmark

commit
view commit

@aleksanderkatan aleksanderkatan self-requested a review September 24, 2025 09:54
Copy link
Contributor

@aleksanderkatan aleksanderkatan left a comment

Choose a reason for hiding this comment

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

Yeah, looks good! 🐀

Comment on lines 116 to 127
c.distributions
.map((dist) =>
tgpu.resolve({
externals: {
f: executor.cachedPipeline(getPRNG(dist).prng),
},
})
.flatMap((dist) =>
c.generators.map((gen) =>
tgpu.resolve({
externals: {
p: executor.pipelineCacheGet(
getPRNG(dist).prng,
getGenerator(gen),
),
},
})
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be cleaner as a nested for...of. Right now the result of the map is not used, so it would be more fitting for forEach anyway.
Also, if we do not get rid of the default, this test has duplicate resolves for the default generator.

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