Skip to content

Hash Dragon descriptors from serialized bytes - #104

Merged
tpn merged 1 commit into
mainfrom
codex/dragon-descriptor-20261019
Oct 20, 2026
Merged

tpn merged 1 commit into
mainfrom
codex/dragon-descriptor-20261019

Conversation

@tpn

@tpn tpn commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Dragon launch descriptors were hashed by reopening their published path. A change between publication and that read could make the expected digest describe different content from the coordinator's descriptor.

Return the exact serialized bytes from atomic JSON publication and hash those bytes in the shared and xPOIS launch paths. Workers then reject a descriptor changed during publication before resolving or constructing the worker target.

Validation: 256 focused tests passed, with one optional test skipped. Regression coverage includes shared workers, single-pass xPOIS, and repeated rounds. All repository pre-commit checks passed.

@tpn
tpn requested a review from melo-gonzo as a code owner October 19, 2026 16:38
@tpn tpn added the ai-review Request a focused CodeRabbit review label Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/cuPhoton/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 45c161c6-91cc-474a-ae1d-6029b9851e2c
📥 Commits

Reviewing files that changed from the base of the PR and between 2b9219b and 4b901d3.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/cuPhoton/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: e78f419a-d974-46df-8137-3c3c38295516
📥 Commits

Reviewing files that changed from the base of the PR and between ffb1d38 and 2b9219b.

📒 Files selected for processing: 5
  • src/cuphoton/core/bulk.py
  • src/cuphoton/core/dragon.py
  • src/cuphoton/xpois/dragon.py
  • tests/core/test_dragon.py
  • tests/xpois/test_dragon.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Walkthrough

atomic_write_json now returns the exact UTF-8 bytes it writes. Dragon launch paths use those bytes to calculate descriptor sizes and SHA-256 digests. Regression tests mutate published descriptors and verify that startup validation rejects them.

Changes: Descriptor Integrity

Layer / File(s) Summary
Return serialized JSON bytes
src/cuphoton/core/bulk.py
atomic_write_json serializes normalized JSON to UTF-8 bytes, writes those bytes in binary mode, and returns them.
Use serialized bytes in Dragon launches
src/cuphoton/core/dragon.py, src/cuphoton/xpois/dragon.py, tests/core/test_dragon.py, tests/xpois/test_dragon.py
Core and xpois launch paths use the returned descriptor bytes for size and SHA-256 calculations. Tests verify that descriptor mutation causes SHA-256 validation to fail before worker execution or target resolution.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 2b921

The descriptor-integrity change is ready to merge after normal checks.

Pre-merge checks: Passed 2
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@tpn

tpn commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@melo-gonzo melo-gonzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Descriptor length and digest now use the exact serialized bytes. Regression tests and publication-race probes confirm that workers reject changed content before starting the worker target.

Return the serialized bytes from atomic JSON publication and use them
to bind worker launch descriptors before the published path can change.
Cover descriptor mutation during publication for both execution APIs.

Signed-off-by: Trent Nelson <trentn@nvidia.com>
@tpn
tpn force-pushed the codex/dragon-descriptor-20261019 branch from 2b9219b to 4b901d3 Compare October 20, 2026 02:27
@tpn
tpn merged commit 5f4de00 into main Oct 20, 2026
59 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a focused CodeRabbit review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants