Skip to content

to_gpu: repair in-run index order at upload (#87) - #99

Merged
aarmey merged 1 commit into
mainfrom
cuda-87-sorted-runs
Nov 15, 2026
Merged

aarmey merged 1 commit into
mainfrom
cuda-87-sorted-runs

Conversation

@aarmey

@aarmey aarmey commented Nov 15, 2026

Copy link
Copy Markdown
Member

Sorting within value-runs is a no-op on arrays built normally (indices are already ascending per run), but VCSC[perm_rows] silently breaks it. This adds a one-pass check at upload and a key sort only when needed, plus tests pinning the invariant across construction/selection paths.

Measured on RTX 5080, VCSC 60,000x2,000 at 20% density after a row permutation, B @ VCSC: width 1 660→144 µs (4.6x), width 2 643→228 µs (2.8x), width 4 664→425 µs (1.6x). Already-canonical arrays pay only the check (~0.2–0.8 ms at 5–24M nnz).

Closes #87. Also tightens the docstring wording (ascending within runs, not across).

@aarmey
aarmey merged commit f7f30d9 into main Nov 15, 2026
8 checks passed
@aarmey
aarmey deleted the cuda-87-sorted-runs branch November 15, 2026 14:07
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.

CUDA kernels: check in-run index order at upload and sort only when it is broken (VCSC at widths 1-2)

1 participant