vxpu/plan: extract and carry segment reads and writes #833
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 528 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.375
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #833"
general
weight: 0.35
codebot-robot
vxpu/proto: add ValueKind, Value, and reads and writes to Segment
Define ValueKind, Value, and reads and writes on Segment in plan.proto
so segments declare what values they read and write.
Values are distinguished by their lifecycle:
Proto doc comments specify what readers may rely on regarding order,
naming (including individual unpacked identifiers for tuple-returning
ops), and lifecycle (including in-place resident mutations). Regenerate
Go and Python protobuf bindings via ap generate.
---
vxpu/plan: extract reads and writes for each segment from the graph
Extract the values each segment reads and writes from the exported
graph (decode.pt2) so that an executor can lay out activation slots
and run segments in order without analysing the graph.
Values are distinguished by lifecycle:
for each step and do not outlive the step.
persist across steps. Every resident value, whether read or written,
names its persistent slot (parameter_name, buffer_name, or
tensor_constant_name) in Value.resident and the segment-local tensor
in Value.name.
returned to the caller.
In vxpu/pkg/kernelplan/segment.go:
source of truth for resident values, step inputs, user outputs, and
buffer mutations; missing specs or missing resident slot names
return an error.
declared step input, a resident value, or written by an earlier
segment, or ReadSegments returns an error naming the value.
while omitting outputs returns an error) and register all output
tensor identifiers for multi-output ops.
producing segment with Name set to the output tensor carrying the
new value and Resident set to the persistent slot it replaces. Any
later segment reading that output tensor in the same step is marked
consistently as VALUE_KIND_RESIDENT with the same Resident slot and
observes the new state, while a read of the pre-step placeholder
observes the start-of-step state. At the end of the step, the
executor commits the mutated output tensor into Resident.
Consequence of refusing archives without signatures or node outputs:
Any test constructing a mock decode.pt2 archive without a signature
or node outputs fails. Every such test on main is updated in this
commit:
TestCmdPlanTree_Synthetic, createArtifactWithNodes and callers,
TestCmdPlanPackages, TestPassThroughPlan_NoOpsModel,
TestPlanTree_GraphWithOpsDefaultSitesMatchNothing,
TestPlanEmit_SegmentRunModes)
The only other test on main that constructs a mock decode.pt2 without
a signature is vxpu/python/vxpu/lower_test.py
(test_go_plan_segments_refusal_named_versions), which tests bad
archive_format, archive_version, and schema_version rejections that
occur before signature validation and continues to pass unchanged.
In vxpu/cmd/vxpu/plan.go and vxpu/cmd/vxpu/treeui/tree.html:
cmdPlanSegments and render them on the model structure tree page.
In dev/ci/presubmits/test-vxpu-python and dev/ci/gpu/test-vxpu-gpu:
Llama artifacts where a skip or failure is fatal.
Fixes #828