pub struct VizPacket {
pub schema: &'static str,
pub claim_id: String,
pub bit_width: u64,
pub viz_hints: VizHints,
pub seed_commitment: String,
pub transcript_digest: String,
pub packet_digest: String,
pub rounds: Vec<VizRound>,
}Expand description
Canonical semantic packet consumed by visualization layers.
Fields§
§schema: &'static strPacket schema.
claim_id: StringSemantic claim identifier.
bit_width: u64Logical claim width.
viz_hints: VizHintsPresentation hints.
seed_commitment: StringDomain-separated transcript seed commitment.
transcript_digest: StringDigest of the ordered semantic transcript.
packet_digest: StringDigest of packet content excluding this field.
rounds: Vec<VizRound>Human-readable rounds.
Implementations§
Source§impl VizPacket
impl VizPacket
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
Serializes the packet as compact deterministic JSON.
Examples found in repository?
examples/drone_observation.rs (line 31)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let claim = LuminousClaim::new("drone-camera-frame-7842", 4096).with_viz_hints(VizHints {
5 color: Some([0, 200, 255]),
6 icon: Some("camera".into()),
7 layer_name: Some("perception-conv3".into()),
8 });
9
10 let mut transcript = BitInteractiveTranscript::new(b"drone-seed-7842");
11 transcript.record_round_with_note(
12 0,
13 &[0xde, 0xad, 0xbe, 0xef],
14 "sensor-processing",
15 "Raw sensor frame converted into features",
16 );
17 transcript.record_round_with_note(
18 1,
19 &[0x42],
20 "attention-head-7",
21 "Stop-sign feature strongly activated",
22 );
23
24 let luminous = SimpleLuminousSumcheck { claim, transcript };
25 let metadata = luminous.to_luminous_metadata();
26 let packet = luminous.to_viz_packet()?;
27 packet.verify()?;
28
29 println!("claim: {}", metadata.claim_id);
30 println!("transcript: {}", metadata.transcript_digest);
31 println!("{}", packet.to_json());
32 Ok(())
33}Sourcepub fn verify(&self) -> Result<(), SlbitError>
pub fn verify(&self) -> Result<(), SlbitError>
Verifies packet structure and deterministic packet digest.
Examples found in repository?
examples/drone_observation.rs (line 27)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let claim = LuminousClaim::new("drone-camera-frame-7842", 4096).with_viz_hints(VizHints {
5 color: Some([0, 200, 255]),
6 icon: Some("camera".into()),
7 layer_name: Some("perception-conv3".into()),
8 });
9
10 let mut transcript = BitInteractiveTranscript::new(b"drone-seed-7842");
11 transcript.record_round_with_note(
12 0,
13 &[0xde, 0xad, 0xbe, 0xef],
14 "sensor-processing",
15 "Raw sensor frame converted into features",
16 );
17 transcript.record_round_with_note(
18 1,
19 &[0x42],
20 "attention-head-7",
21 "Stop-sign feature strongly activated",
22 );
23
24 let luminous = SimpleLuminousSumcheck { claim, transcript };
25 let metadata = luminous.to_luminous_metadata();
26 let packet = luminous.to_viz_packet()?;
27 packet.verify()?;
28
29 println!("claim: {}", metadata.claim_id);
30 println!("transcript: {}", metadata.transcript_digest);
31 println!("{}", packet.to_json());
32 Ok(())
33}Trait Implementations§
impl Eq for VizPacket
impl StructuralPartialEq for VizPacket
Auto Trait Implementations§
impl Freeze for VizPacket
impl RefUnwindSafe for VizPacket
impl Send for VizPacket
impl Sync for VizPacket
impl Unpin for VizPacket
impl UnsafeUnpin for VizPacket
impl UnwindSafe for VizPacket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more