Skip to content

Updated context gets passed *all the way* downstream.#142

Open
bkorycki wants to merge 2 commits into
mainfrom
context-bug
Open

Updated context gets passed *all the way* downstream.#142
bkorycki wants to merge 2 commits into
mainfrom
context-bug

Conversation

@bkorycki
Copy link
Copy Markdown
Contributor

Example: node A -> node B -> node C.
Assume node A updates the context.

Before: node B would see that updated context, but node C would only see the original context.
Now: the updated context is floated all the way down stream (or until it's updated by another node).

Before, this was a problem in our security DAG; the refusal detector would see the decoded sut response, but then the safety arbiter would only see the original, encoded response.

Let me know if my fix has consequences that I am not thinking of.

@bkorycki bkorycki requested a review from superdosh May 21, 2026 18:22
@bkorycki bkorycki requested a review from a team as a code owner May 21, 2026 18:22
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

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.

The only case where this is a bit tricky is where you have two parallel nodes.

Suppose you have Node A -> (Node B, Node C) -> Node D

Because we run Node B and Node C sequentially, Node C will see the updated context from Node B.

But I think this isn't an issue, because later we enforce that all parents of Node D must produce the same updated context, so I think it's safe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The code is actually smart enough right now to handle the parallel case as well! Because when we update the context, we only pass the outputs from that node's predecessors. And node B is not a predecessor for node C.

I added some more tests to confirm that things work as expected.

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.

2 participants