Skip to content

witness: add optional device backing metadata to RowMajorMatrix#33

Merged
hero78119 merged 5 commits intomainfrom
feat/witness_gpu_buffer
Apr 21, 2026
Merged

witness: add optional device backing metadata to RowMajorMatrix#33
hero78119 merged 5 commits intomainfrom
feat/witness_gpu_buffer

Conversation

@hero78119
Copy link
Copy Markdown
Collaborator

@hero78119 hero78119 commented Apr 13, 2026

Problem

GPU-side code needs a way to associate device-resident witness storage with witness::RowMajorMatrix without coupling the witness crate to a concrete device runtime.

Approach

Add optional device-backing metadata to RowMajorMatrix, including an opaque storage handle, layout enum, and small helper APIs to set, clear, query, and downcast the backing.

Testing

No dedicated PR-level tests yet.

Risk / Rollout

Low surface-area API change in witness, but correctness depends on keeping device metadata consistent with host-side matrix state.

Copilot Reviewer Directive (keep this section)

When Copilot reviews this PR, apply .github/copilot-instructions.md strictly.

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

Adds optional device-backing metadata to witness::RowMajorMatrix so callers can attach an opaque device storage handle plus a layout tag.

Changes:

  • Add device_backing: Option<…> to RowMajorMatrix and initialize it to None in constructors.
  • Introduce DeviceMatrixLayout and internal DeviceMatrixBacking.
  • Add public APIs to set/clear/query/downcast the device backing.

Comment thread crates/witness/src/lib.rs
Comment thread crates/witness/src/lib.rs Outdated
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

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

Comment thread crates/witness/src/lib.rs
Comment thread crates/witness/src/lib.rs
@hero78119 hero78119 enabled auto-merge (squash) April 21, 2026 08:56
@kunxian-xia
Copy link
Copy Markdown
Collaborator

@copilot whenever the host side copy of RowMajorMatrix is modified, does the changes also reflected automatically on the device side? If not, please highlight this in the comment.

auto-merge was automatically disabled April 21, 2026 09:12

Head branch was pushed to by a user without write access

@hero78119 hero78119 enabled auto-merge (squash) April 21, 2026 09:14
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

@copilot whenever the host side copy of RowMajorMatrix is modified, does the changes also reflected automatically on the device side? If not, please highlight this in the comment.

No—host-side updates are not automatically reflected on device storage. I’ve clarified this explicitly in RowMajorMatrix docs (no automatic host<->device sync; mutable host access invalidates device metadata) in commit 0334012.

Copilot AI requested a review from kunxian-xia April 21, 2026 09:20
@hero78119 hero78119 merged commit a3538e3 into main Apr 21, 2026
2 checks passed
@hero78119 hero78119 deleted the feat/witness_gpu_buffer branch April 21, 2026 09:22
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.

4 participants