Skip to content

Add public owning_table_view and use it in gpu_table_representation#162

Draft
bwyogatama wants to merge 1 commit into
NVIDIA:mainfrom
bwyogatama:feat/owning-table-view
Draft

Add public owning_table_view and use it in gpu_table_representation#162
bwyogatama wants to merge 1 commit into
NVIDIA:mainfrom
bwyogatama:feat/owning-table-view

Conversation

@bwyogatama

@bwyogatama bwyogatama commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports sirius's op::scan::owning_table_view into cuCascade as a public cucascade::owning_table_view (cudf + rmm only), and refactors gpu_table_representation to use it internally. Sirius can drop its copy and adopt this one at the next submodule bump.

Changes

  • New cucascade::owning_table_view: a handle that is an owned cudf::table, a view backed by a type-erased owner, or empty. Zero-copy select/drop/reorder_columns; materialize()/release() move buffers out of exclusively-owned owners (e.g. unique_ptr<cudf::table>) and copy otherwise.
  • Hardening over the sirius original: shared owners (shared_ptr) now copy instead of being gutted, and an identity guard falls back to copy when the base view doesn't match the owner's columns — both were silent-corruption hazards. Sirius's own usage is unaffected (all 10 original test cases pass unchanged).
  • gpu_table_representation: public API unchanged; internal std::variant/std::any replaced by owning_table_view. Move-only owners now work in the view ctor. New materialize_table(stream) realizes a view state in place (wait on writer event → materialize → re-record). release_table() now leaves a defined empty state instead of UB and allocates from the representation's memory space.

Verification

Release build clean under -Werror; new [owning_table_view] + [materialize_table] tests plus all pre-existing tests pass (ctest 3/3); pre-commit run -a clean.

🤖 Generated with Claude Code

Port sirius's op::scan::owning_table_view into cuCascade as a public
cucascade::owning_table_view (cudf+rmm only): a 3-state handle (owned
cudf::table / type-erased owner + column selection / empty) with
zero-copy select/drop/reorder_columns and move-or-copy materialize()/
release(). Two hardening deltas over the sirius original close silent-
corruption hazards: the no-alloc move path requires exclusive ownership
(shared_ptr owners now copy instead of gutting co-owners), and a
buffer-identity guard falls back to copying when the base view does not
name the owner's actual columns.

Refactor gpu_table_representation to hold an owning_table_view instead
of the std::variant / std::any nested struct. Public API is unchanged;
move-only owners now work in the view ctor, and release_table() leaves
a defined empty state (size 0, empty view, nullptr on re-release)
instead of undefined behavior. New materialize_table(stream) realizes a
view state in place under the STREAM-LINEAGE contract (wait on the
writer event, materialize, re-record), allocating copies from the
representation's memory space rather than the ambient device resource.

Follow-ups (out of scope): sirius can drop its copy of the class at the
next cuCascade submodule bump; column-op delegates on
gpu_table_representation can be added when a consumer appears.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@bwyogatama

Copy link
Copy Markdown
Contributor Author

/ok to test

@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

/ok to test

@bwyogatama, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

@bwyogatama

Copy link
Copy Markdown
Contributor Author

/ok to test ade693f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant