Skip to content

Add support for state_header access in the SDK - #205

Open
ed255 wants to merge 22 commits into
mainfrom
feat/actiom-state-3
Open

Add support for state_header access in the SDK#205
ed255 wants to merge 22 commits into
mainfrom
feat/actiom-state-3

Conversation

@ed255

@ed255 ed255 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Resolve #201

I had to merge the In/Out records into a single IO one because even after the splitter did its thing, there were predicates that had 9 wildcards (our max is 8).
I believe this change doesn't introduce any performance regression and gets rid of one wildcard in some occasions.

Note for the reviewer: I haven't yet tested the correct behavior of the synchronizer after this PR nor an end 2 end flow because I don't have access to my everyday machine and I did this on 8GB of RAM 🫠

/// slot index is `ts - 1` and the step name is `step_{ts-1}`.
pub(crate) fn chain_step_at(ts: usize, chain_max_ts: usize) -> Option<usize> {
(chain_packed(chain_max_ts) && ts > 0 && ts < chain_max_ts).then_some(ts - 1)
(chain_packed(chain_max_ts) && ts > 0 && ts < chain_max_ts).then(|| ts - 1)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There was an underflow here (which was detected in debug mode).
On underflow this results in None, but in debug an underflow panics. By using a closure the subtraction only happens when the check passes.

@ed255
ed255 force-pushed the feat/actiom-state-3 branch from 8150748 to dffc01c Compare July 29, 2026 16:50
@ed255
ed255 force-pushed the feat/actiom-state-3 branch from dffc01c to b46f259 Compare July 29, 2026 17:08
@ed255
ed255 force-pushed the feat/actiom-state-3 branch from 1fccba6 to 2c61de0 Compare July 29, 2026 17:49
@ed255
ed255 requested a review from dhvanipa July 29, 2026 19:11
@dhvanipa
dhvanipa requested a review from robknight July 30, 2026 15:56
@dhvanipa

Copy link
Copy Markdown
Collaborator

what does d-- in "kind": "d--" mean? I think d is dictionary but not sure what the dashes are

@dhvanipa

dhvanipa commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

FYI - confirmed e2e objects are produced and synchronizer runs fine

Some docs are outdated and the GUI rendering is broken cuz of the new object structure but I updated those here #206

Comment thread libs/sdk/src/lib.rs Outdated
@ed255

ed255 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

what does d-- in "kind": "d--" mean? I think d is dictionary but not sure what the dashes are

This is inspired by the read/write/execute flags of files display in Unix. So d-- means:

  • dictionary: yes
  • set: no
  • array: no
    The reason for using bit flags is because there are cases where a container can be multiple kinds at the same time. Here's the full context Add ContainerKind 0xPARC/pod2#526

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.

Extend SDK to read StateHeader ergonomically

3 participants