Skip to content

docs: Tests for prefix scan#1804

Merged
lursz merged 13 commits intofeat/concurrent-sum-debugfrom
docs/tests-for-concurrent-sum
Oct 27, 2025
Merged

docs: Tests for prefix scan#1804
lursz merged 13 commits intofeat/concurrent-sum-debugfrom
docs/tests-for-concurrent-sum

Conversation

@aleksanderkatan
Copy link
Copy Markdown
Contributor

Changes:

  • replace old test example with a new one.

There is no resolve test because it times out, and the number of called resolves is really uncertain.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 13, 2025

pkg.pr.new

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

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

benchmark
view benchmark

commit
view commit

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces an old concurrent scan test example with comprehensive prefix scan tests. The changes introduce a new test suite that validates both scan and prefix scan operations with various edge cases and data sizes.

Key changes:

  • Complete replacement of the concurrent scan test with a comprehensive prefix scan test suite
  • Export of BinaryOp type from the prefix scan module
  • New helper functions for JavaScript-based reference implementations

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/typegpu-concurrent-scan/src/prefixScan.ts Exports BinaryOp type for external use
apps/typegpu-docs/src/examples/tests/prefix-scan/meta.json Updates test title from "Concurrent Scan Test" to "Prefix Scan Tests"
apps/typegpu-docs/src/examples/tests/prefix-scan/index.ts Adds comprehensive test suite with multiple test cases for scan and prefix scan operations
apps/typegpu-docs/src/examples/tests/prefix-scan/index.html Provides minimal HTML for test result display
apps/typegpu-docs/src/examples/tests/prefix-scan/functions.ts Implements helper functions including binary operations and JavaScript reference implementations
apps/typegpu-docs/src/examples/tests/concurrent-scan/index.ts Removes old concurrent scan test implementation
apps/typegpu-docs/src/examples/tests/concurrent-scan/index.html Removes old HTML for concurrent scan test

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread apps/typegpu-docs/src/examples/tests/prefix-scan/index.ts Outdated
Comment thread apps/typegpu-docs/src/examples/tests/prefix-scan/index.ts Outdated
aleksanderkatan and others added 2 commits October 13, 2025 14:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@aleksanderkatan aleksanderkatan requested a review from lursz October 13, 2025 13:23
@aleksanderkatan aleksanderkatan marked this pull request as ready for review October 13, 2025 13:23
Copy link
Copy Markdown
Contributor

@reczkok reczkok left a comment

Choose a reason for hiding this comment

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

Very elegant! Great work

Copy link
Copy Markdown
Collaborator

@cieplypolar cieplypolar left a comment

Choose a reason for hiding this comment

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

Great work 🎰 1 nit though, I would love to see shellless functions in ./functions.ts, but in order to do that base branch needs to be updated.

EDIT1:
Wait with merging I want to add vector and matrix tests :)

EDIT2:
Nevermind, BinaryOp signature won't allow me.

Copy link
Copy Markdown
Collaborator

@cieplypolar cieplypolar left a comment

Choose a reason for hiding this comment

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

There exists round function in std 😉

Comment thread apps/typegpu-docs/src/examples/tests/prefix-scan/functions.ts Outdated
Co-authored-by: Szymon Szulc <103948576+cieplypolar@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@lursz lursz left a comment

Choose a reason for hiding this comment

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

Great work!

@lursz lursz merged commit 8b5b87d into feat/concurrent-sum-debug Oct 27, 2025
5 checks passed
@aleksanderkatan aleksanderkatan deleted the docs/tests-for-concurrent-sum branch November 14, 2025 12:01
iwoplaza added a commit that referenced this pull request Feb 20, 2026
* concurrent sum module

* compute shader blueprint

* endeavour to run compute shader

* introduced std log and std log2

* log now supports vectors

* removed redundant files

* log in vectorops

* added tests

* complete tests

* updated to main

* Fixes - compute shader runs

* alg fixes

* working presum

* introduced concurrent-sum example

* concurrent sum in math examples

* finally somewhat parallel

* Fixed exceeding workgroup size

* One function to wrap the compute shader

* packed whole concurrent-sum

* Added quicker concurrentSum algorithm - shared memory

* each thread copies two values into shared memory, instead of one

* Found workGroupSize buffer

* Introduced sums scan

* Compute shader used for sums

* export fixes

* incrementSHader

* Found copy bug

* alg fix

* Dynamic buffer length support

* Now supporting optional buffer as output

* no more consts

* Divided into upPass and downPass

* Refmt

* work in progress

* Fixed

* reintroduced down pass

* warning fixes

* Fully working impl

* example for testing

* clean layouts

* fully working recursive step

* Dispatching multiple workgroups

* supporting optional buffer

* stash the cache

* buffer cache

* nits

* performance inprovements

* alternative cache

* gpu time

* refactor of types

* 🦕

* basic support for any operation

* concurrent sum supports all operators now

* example tidy up

* removed unnecessary flush

* example improvements

* types

* Support for single element sum

* example sanity changes'

* filenames

* 🦕

* fixes

* 🦕

* 🦕

* flex example

* lines

* speed up isntead of time

* some improvements

* tailwind baby

* 3 values

* working example

* pr fixes

* html simplifiaction

* other operators fix

* typo

* length is now chooseable

* fixed on mobile

* tgpu callable

* profile pic mod

* copilot

* buttons cleanup

* introduced calculate index

* got rid of ugly casts

* Major rename

* Removed old concurrent sum example

* 🦕

* typo

* better cache

* oppsies

* html changes

* height control

* looking goood on mobile

* 🦕

* dynamic y axis

* rename

* 🦕

* PR fixes 1

* fix

* single element scan fix

* 🦕

* proper private values

* docs and tests

* farewell buffer cache

* 🦕

* Merge fixes

* docs: Tests for prefix scan (#1804)

* jsdocs example

* implicit single scan conv

* fix timestamp queries

* 🦕🦕🦕

* tgpu bump 0.6 -> 0.8

* API option 4

* 🦕🦕🦕

* 🦕🦕🦕🦕

* tgpu version bump

* PR fixes 1

* Code duplication with scan (only difference is true vs false), this body can be extracted to a helper function.

* outputBuffer does not work in scan (there is always a new one-element buffer returned)

* fix faulty test

* ordering of lines

* removed number cast

* simplified array init

* bars opacity in loop

* readme change

* .with update

* better pipeline if

* removed tgpu callable

* uniformAdd -> uniformOp

* fix, simplify, modernize (#2164)

* simplify (#2169)

* COMBINE (#2182)

* add -> op

* export computer for *advanced* usage I guess :P

* two level cache

* fixes

* better wording imp

---------

Co-authored-by: Iwo Plaza <iwoplaza@gmail.com>
Co-authored-by: Aleksander Katan <56294622+aleksanderkatan@users.noreply.github.com>
Co-authored-by: Aleksander Katan <aleksander.katan@swmansion.com>
Co-authored-by: Konrad Reczko <reczkok@gmail.com>
Co-authored-by: Konrad Reczko <66403540+reczkok@users.noreply.github.com>
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.

5 participants