docs(hy_worldplay/wan22): tighten AI-generated comments and docstrings#314
Conversation
Per Ruilong's PR #224 request for a separate cleanup pass: trim the agent's chain-of-thought and historical narration from comments and docstrings across the HY-WorldPlay + wan22 integration, leaving tight, user-facing docs plus one-line correctness invariants. Comments and docstrings only -- zero executable-code changes (verified by AST comparison with all string-literal statements stripped). CPU test suite (93 passed) and ruff v0.12.7 format/import checks green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryPure documentation cleanup across the HY-WorldPlay + wan22 integration: AI-generated chain-of-thought, historical narration, and vendor-code call-site references are trimmed from comments and docstrings. No executable code is changed.
Confidence Score: 5/5Safe to merge — no executable code is touched; the changes are entirely documentation. Every diff line is a comment, docstring, or string literal. The two new findings concern small but useful explanations that were deleted (the derivation of a magic constant and the rationale for a seemingly-redundant helper call); neither deletion will cause incorrect behaviour at runtime. The five files that carry issues flagged in this review or prior threads — Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[HyWorldPlayWanI2VRunner.run] --> B[preprocess_first_frame]
B --> C[encode first frame via VAE]
C --> D[AR loop: for ar_idx in range num_chunk]
D --> E{ar_idx == 0?}
E -- yes --> F[pipeline.generate chunk 0\nno memory prefill]
E -- no --> G[_prefill_memory_kv_cache\nslice clean-latent history\nbuild collapsed RoPE freqs\nfor each PRoPE block]
G --> H[HyWorldPlayWanDiTNetwork.prefill_memory_kv\nwrites K/V into block cache.memory]
H --> I[pipeline.generate chunk N\nforward_dual_branch prepends\nmemory K/V to rolling K/V]
F --> J[pipeline.finalize\nappend clean latent to history\nadvance KV cache]
I --> J
J --> D
D -- done --> K[decode chunks via VAE\nwrite mp4]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[HyWorldPlayWanI2VRunner.run] --> B[preprocess_first_frame]
B --> C[encode first frame via VAE]
C --> D[AR loop: for ar_idx in range num_chunk]
D --> E{ar_idx == 0?}
E -- yes --> F[pipeline.generate chunk 0\nno memory prefill]
E -- no --> G[_prefill_memory_kv_cache\nslice clean-latent history\nbuild collapsed RoPE freqs\nfor each PRoPE block]
G --> H[HyWorldPlayWanDiTNetwork.prefill_memory_kv\nwrites K/V into block cache.memory]
H --> I[pipeline.generate chunk N\nforward_dual_branch prepends\nmemory K/V to rolling K/V]
F --> J[pipeline.finalize\nappend clean latent to history\nadvance KV cache]
I --> J
J --> D
D -- done --> K[decode chunks via VAE\nwrite mp4]
Reviews (2): Last reviewed commit: "Merge branch 'main' into dev/wenqingw-nv..." | Re-trigger Greptile |
|
|
||
| Ports the bit pattern of ``hyvideo/prope/camera_rope.py::prope_qkv`` from | ||
| `PRoPE: Projective Positional Encoding for Multiview Transformers | ||
| <https://github.com/Tencent-Hunyuan/HY-WorldPlay/blob/main/hyvideo/prope/camera_rope.py>`_ | ||
| (MIT-licensed) so the native HY-WorldPlay path can apply per-camera | ||
| projective transforms to Q/K/V before attention without importing the | ||
| upstream HY-WorldPlay tree at runtime. | ||
|
|
||
| The transform is a block-diagonal matrix multiply on the per-head feature | ||
| Applies per-camera projective transforms to Q/K/V before attention. The | ||
| transform is a block-diagonal matrix multiply on the per-head feature | ||
| axis: each camera's tokens get multiplied by a 4×4 matrix derived from |
There was a problem hiding this comment.
MIT attribution removed from ported code
The old module docstring explicitly stated this file "Ports the bit pattern of hyvideo/prope/camera_rope.py::prope_qkv from PRoPE: Projective Positional Encoding for Multiview Transformers (MIT-licensed)." The cleanup pass removed the upstream GitHub URL and the MIT-license callout entirely. Even though the file header carries Apache-2.0, the ported code originates from a distinct MIT-licensed third-party repository. Dropping the source URL and license notice makes it harder to trace provenance, reconcile against upstream changes, or satisfy any downstream audit that asks where the PRoPE math came from.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
liruilong940607
left a comment
There was a problem hiding this comment.
TY! Always love to see cleanups!
|
/ok to test 6c58789 |
Signed-off-by: Ruilong Li(李瑞龙) <ruilongl@nvidia.com>
|
/ok to test 8f41409 |
Separate doc-cleanup pass requested by @liruilong940607 in the PR #224 review — trim the agent's chain-of-thought / historical narration from comments and docstrings across the HY-WorldPlay + wan22 integration (in the spirit of the omnidreams deslop, #292).