docs(coding-style): document orch output direction (pl.Out / pl.InOut)#669
Conversation
Add a subsection to section 1 spelling out the rule this PR applies: every golden-compared output must declare a direction on the orchestration entry (plain pl.Tensor is In → copy-back skipped → reads back all-zeros), chosen by the TensorSpec — pl.Out for pure outputs, pl.InOut for is_output+init_value inout caches/state. Annotate the entry only; inline sub-kernels keep bare pl.Tensor (direction stripped at splice, warns). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change adds a new documentation subsection to docs/pypto-coding-style.md describing required tensor output direction annotations (pl.Out/pl.InOut) on orchestration entries, the failure mode for bare pl.Tensor parameters, inline sub-kernel behavior, and an example. ChangesDocumentation update
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the docs/pypto-coding-style.md documentation by adding a new section on output parameter direction using pl.Out and pl.InOut. It explains when to use these annotations based on TensorSpec properties, clarifies that they should only be applied to orchestration entries (and not inline sub-kernels), and provides a code example illustrating the correct usage. There are no review comments, so we have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What
Documents the orchestration-output direction convention applied in #659, so the rule lives in the canonical coding-style guide.
Adds a subsection "Output parameter direction:
pl.Out/pl.InOut" to §1 ofdocs/pypto-coding-style.md:pl.TensorisIn, so its device→host copy-back is skipped and the tensor reads back as all-zeros on the host (golden silently fails).TensorSpec:is_output=True, noinit_value→ pure output →pl.Out[...]is_output=True+init_value→ inout (read-modify-write cache/state) →pl.InOut[...]@pl.jit.inlinesub-kernels keep barepl.Tensor(direction is stripped at splice and warns). Entrypl.InOut+ bare-pl.Tensorinline is the correct pairing.Docs-only; includes a short
attention_csa_testexample.🤖 Generated with Claude Code