Add PORTING.md: status, memory model, and roadmap for the GPU port - #142
Merged
Conversation
Issue #115 has been the only overview of the port, and its tier checklist is stale -- it describes the first attempt (PRs #121-#129), none of which is on dev, whose history runs straight from #120 to #130. This adds a repository-root document that supersedes that checklist as the status reference, while leaving #115 as the place the individual design decisions were argued out. The bulk of it is the memory model the restart is built on -- store an offset, not a pointer; the base is supplied by the caller -- and a post-mortem of why the first attempt was rewound. That attempt did not fail on its evaluation design; it failed on memory placement, which it treated as a final integration step. Its TapeView held raw pointers, so the same value could never be valid on both sides; DeviceTape hand-rolled a single-purpose pool (DeviceTapeAlign = 256, padUp/paddedBytes/uploadArray) that nothing else could reuse; and every array had to be enumerated by hand at upload. All three are work created by designing host-first around std::vector and bolting device residency on afterwards, which is why the restart landed the memory foundation first, as PR #130. Also records what survived (the GPU portability layer, carried into #130; the linear-SSA tape design), the current ported/not-ported inventory, the roadmap, a recipe for porting a class, and how to actually run the device tests -- CI compiles both backends but has no GPU, so a green GPU lane means "it compiles" and nothing more. The roadmap deliberately separates the analytic-SDF trait refactor from the tape: the formulas carry no memory-placement problem at all, so that step is independent of the memory work and can run in parallel with the BVH port, rather than queuing behind it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The first attempt's trait refactor deleted SignedDistanceFunction<T> outright and collapsed everything onto ImplicitFunction<T, Op> + bool m_sdf. That is a user-visible API break with no GPU motivation of its own, so it should not ride along with the trait step; note it explicitly so the next person doing that work does not repeat the removal by default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rmrsk
marked this pull request as ready for review
August 12, 2026 18:46
Owner
Author
|
@claude review |
|
Claude finished @rmrsk's task in 1m 22s —— View job Review complete ✅
Docs-only PR, and it's in good shape. I cross-checked the technical claims against the actual source tree rather than just reading prose:
Nothing to flag — no bugs to find in a status/planning document, and every concrete API/file claim I checked matches the current
This is exactly the kind of document the project's |
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.
Summary
Background
Issue #115 has been the only overview of the GPU port, and its tier checklist is stale: it
describes the first attempt (PRs #121-#129), none of which is on
dev-- that history runsstraight from #120 to #130. Anyone picking up the port has had no single place to learn the memory
model it is built on, what is ported so far, or why the previous attempt was rewound.
Solution
Adds
PORTING.mdat the repository root as the authoritative status document, leaving #115 as therecord of how individual design decisions were argued out.
Its core is the memory model -- store an offset, not a pointer; the base is supplied by the
caller -- and a post-mortem of the first attempt. That attempt did not fail on its evaluation
design; it failed on memory placement, which it treated as a final integration step rather than a
foundation:
TapeView<T>held raw pointers, so one view value could never be valid on both host and device;DeviceTapehad to rebuild a second view with device addresses after upload.DeviceTapehand-rolled a single-purpose pool (DeviceTapeAlign = 256,padUp(),paddedBytes(),uploadArray()) that nothing else could reuse.PoolBaseAlignis the same 256bytes today.
All three are work created by designing host-first around
std::vectorand adding device residencyafterwards, which is why the restart landed the memory foundation first as #130.
The document also records what survived (the GPU portability layer, carried into #130 and extended
with the managed/pinned/mapped wrappers; the linear-SSA tape design), the current ported /
not-ported inventory, the roadmap, a recipe for porting a class, and how to actually run the device
tests locally.
Two roadmap decisions are captured explicitly:
memory-placement problem at all, so that step is independent of the memory work and can run in
parallel with the BVH port instead of queuing behind it.
SignedDistanceFunction<T>stays for now. The first attempt deleted it as part of the traitrefactor; that is a user-visible API break with no GPU motivation of its own and should be
revisited on its own terms.
Side-effects
Documentation only -- no source, test or build changes, so no effect on the library, its API or its
test suite.
README.mdgains one sentence pointing GPU-port contributors atPORTING.md.Docs/Sphinx/source/Contributing.rstgains the same pointer, cross-referenced to the existingMemory model page.
REUSE.tomllistsPORTING.mdin the existing bulk-licensing block for top-level markdown.Sphinx builds clean (0 warnings), and
reuse,codespellandcheck-docsall pass.Alternative solutions
not discoverable from the repository, and the issue is more useful left as the historical record
of the decisions rather than rewritten to match current state.
documentation of what the library does, whereas this is contributor-facing status for work in
progress, closer in kind to
CLAUDE.md. It is linked from the Contributing page so it is stillreachable from the user guide.
Reviewer checklist (to be completed by a human)
@claude review.