Skip to content

refactor(draft): codify proposal row layout#528

Open
dusterbloom wants to merge 1 commit into
Luce-Org:mainfrom
dusterbloom:feat/dspark-draft-contract
Open

refactor(draft): codify proposal row layout#528
dusterbloom wants to merge 1 commit into
Luce-Org:mainfrom
dusterbloom:feat/dspark-draft-contract

Conversation

@dusterbloom

@dusterbloom dusterbloom commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make the draft proposal-row layout explicit instead of deriving every artifact as seed plus proposals.

This adds a small DraftProposalShape contract with two layouts:

  • SeedThenProposals for existing DFlash and DS4 artifacts
  • ProposalsOnly for draft artifacts that emit candidate rows without the accepted seed

DraftWeights defaults to SeedThenProposals, so existing artifacts keep their current behavior.

Why

The current block_size field is used both as an artifact row count and as a target verification width. Those values are equal for seed-plus-proposal artifacts, but not for proposal-only artifacts: four proposal rows require a five-row target verification batch after the accepted anchor is prepended.

Encoding that distinction as row-layout metadata keeps proposal count and verification width unambiguous without model-name conditionals. No runtime path consumes the new field in this PR; it establishes the shared representation used by follow-up integrations.

Validation

The CPU-only contract test covers:

  • existing 16-row layout: 15 proposals, verify width 16
  • proposal-only 4-row layout: 4 proposals, verify width 5
  • zero and one-row boundaries: zero proposals, verify width 1
  • default layout compatibility
c++ -std=c++17 -Wall -Wextra -Werror -Iserver/src server/test/test_draft_contract.cpp -o /tmp/test_draft_contract
/tmp/test_draft_contract
git diff --check origin/main...HEAD

All passed locally. The test links no GGML or GPU library and is included in both forms of the CMake check target.

No throughput benchmark is included because this PR does not change a runtime graph, kernel, scheduler, or model-loading path.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 4 files

Re-trigger cubic

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.

1 participant