Skip to content

test(ds4): preserve reference-exact speculative verification - #548

Open
cheese-cakee wants to merge 4 commits into
Luce-Org:mainfrom
cheese-cakee:codex/fix-ds4-fused-verify
Open

test(ds4): preserve reference-exact speculative verification#548
cheese-cakee wants to merge 4 commits into
Luce-Org:mainfrom
cheese-cakee:codex/fix-ds4-fused-verify

Conversation

@cheese-cakee

@cheese-cakee cheese-cakee commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve DFLASH_DS4_SPEC_REFERENCE_EXACT=1 as the supported reference-exact speculative verification mode
  • keep DFLASH_DS4_FUSED_VERIFY=1 intentionally approximate for throughput experiments
  • add a model-backed AR-vs-reference-exact token-ID parity gate with fail-closed evidence checks
  • register parser and environment regressions with CTest

This replaces the superseded historical diff on current main. The previous fail-closed fused-flag policy is intentionally not restored: reference-exact verification and approximate fused verification are separate modes.

Exactness contract

The gate holds the target execution policy constant between greedy AR and reference-exact speculation, sanitizes inherited DS4/MoE/MMVQ policy variables, and differs only in DSpark/spec/reference-exact activation. It requires:

  • identical complete generated token-ID sequences
  • the reference-exact activation banner
  • speculative work with exact integer matched / offered counters
  • at least one rejection (matched < offered)
  • full_snap=1, proving the rollback-capable path was active
  • SHA-256 identities for the server binary, target GGUF, DSpark GGUF, and prompt

The gate retains both logs and a manifest instead of overwriting evidence.

Validation completed

  • parser/environment unit tests: 11/11 passed
  • Python byte compilation passed
  • targeted Ruff check and format check passed
  • git diff --check passed
  • fresh independent final-diff review: no remaining findings

Pending before ready-for-review / exactness claim

  • full current-tree CUDA and HIP builds
  • model-backed gfx1151 run on the target Lucebox hardware with the pinned artifacts
  • observed rejection/rollback and complete token parity from that run

The Lucebox machines and target artifacts are currently unavailable, so this is reopened as a draft. No target-hardware parity or performance result is claimed yet. Historical CI and reviews applied to the superseded implementation and should not be treated as evidence for this rewrite.

Stack

Independent current-main PR. It does not depend on #554 or the #569/#575/#577 performance stack.

@cheese-cakee
cheese-cakee marked this pull request as ready for review July 20, 2026 14:12

@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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/deepseek4/deepseek4_backend.cpp Outdated
@cheese-cakee cheese-cakee changed the title fix(ds4): preserve exact speculative verification test(ds4): preserve reference-exact speculative verification Aug 4, 2026
@cheese-cakee cheese-cakee reopened this Aug 4, 2026
@cheese-cakee
cheese-cakee marked this pull request as draft August 4, 2026 20:44
@cheese-cakee
cheese-cakee force-pushed the codex/fix-ds4-fused-verify branch from cba8487 to 82a3377 Compare August 4, 2026 20:44
@cheese-cakee
cheese-cakee marked this pull request as ready for review August 4, 2026 21:39

@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.

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/deepseek4/deepseek4_backend.cpp
Comment thread server/scripts/test_ds4_exact_verify_parity.py Outdated
Comment thread server/src/deepseek4/deepseek4_backend.cpp Outdated
Comment thread server/scripts/test_ds4_exact_verify_parity.py

@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.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread server/scripts/test_ds4_exact_verify_parity.py Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread server/scripts/test_ds4_exact_verify_parity.py Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
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