Skip to content

Refactor Diamond injector to per-state B checkpoints#127

Merged
SoraSuegami merged 1 commit into
mainfrom
codex/refactor-diamond-injector
May 20, 2026
Merged

Refactor Diamond injector to per-state B checkpoints#127
SoraSuegami merged 1 commit into
mainfrom
codex/refactor-diamond-injector

Conversation

@SoraSuegami

Copy link
Copy Markdown
Member

Summary

  • Remove W-based Diamond injector paths and switch transitions/final projections to per-(level, state) B checkpoints
  • Replace preimage_extend usage with preimage across Diamond injector, DiamondWE, and DiamondIO flows
  • Update storage and benchmark estimators, GPU paths, and affected tests to match the new shape and checkpoint layout

Testing

  • cargo +nightly fmt --all
  • cargo test diamond_injector
  • cargo test diamond_we
  • cargo test diamond_io
  • cargo check --lib --features gpu
  • Targeted GPU relation and plot test validation passed

@SoraSuegami SoraSuegami marked this pull request as ready for review May 19, 2026 20:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b195ab435

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/input_injector/mod.rs
Comment on lines 806 to 810
assert_eq!(
self.read_bytes(dir_path, self.preprocess_hash_key_id()).as_slice(),
&preprocess_out.hash_key,
"DiamondInjector online_eval preprocess hash key mismatch"
preprocess_out.final_state_count(),
self.state_count_at_level(self.input_count),
"DiamondInjector final checkpoint count mismatch"
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore artifact identity check in online_eval

online_eval now only verifies the final checkpoint count and static metadata, so a preprocess_out from a different preprocessing run (or different artifact directory) with the same input_count/base/batch_bits will pass validation. In that case, state transitions are read from dir_path but final projection preimages are later sampled from mismatched final checkpoints, which can silently break DiamondWE/DiamondIO correctness (wrong decryptions/outputs) instead of failing fast. The previous hash-key binding check prevented this cross-artifact mix-up.

Useful? React with 👍 / 👎.

@SoraSuegami SoraSuegami merged commit c7c4fea into main May 20, 2026
3 checks passed
@SoraSuegami SoraSuegami deleted the codex/refactor-diamond-injector branch May 20, 2026 02:23
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