Skip to content

docs(hy_worldplay/wan22): tighten AI-generated comments and docstrings#314

Open
wenqingw-nv wants to merge 1 commit into
mainfrom
dev/wenqingw-nv/hy-worldplay-doc-cleanup
Open

docs(hy_worldplay/wan22): tighten AI-generated comments and docstrings#314
wenqingw-nv wants to merge 1 commit into
mainfrom
dev/wenqingw-nv/hy-worldplay-doc-cleanup

Conversation

@wenqingw-nv

@wenqingw-nv wenqingw-nv commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

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).

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) <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

A documentation-only cleanup pass across 11 files in the HY-WorldPlay and wan22 integrations, trimming AI-generated chain-of-thought narration from comments and docstrings. The PR author verified zero AST changes (parse → strip string literals → compare trees) and the full CPU test suite passes.

  • Most changes are safe rewrites of verbose vendor-attribution prose into concise descriptions; executable paths, signatures, and config values are entirely untouched.
  • _prope.py's module docstring drops the explicit credit and GitHub URL for the MIT-licensed hyvideo/prope/camera_rope.py port, removing the only in-file record of the upstream source and its license.
  • vae.py's remap header flips from "opt-in fallback" to "production VAE load path" — more consistent with the actual production config defaults, but silently removes the only mention of the Wan2.2_VAE.pth / WAN22_TI2V_5B_VAE_PATH no-remap alternative.

Confidence Score: 4/5

Safe to merge for runtime behaviour; the one item worth resolving before merging is restoring the upstream attribution in _prope.py.

All 11 files are comments/docstrings only and the AST-identity check described in the PR gives strong assurance no executable logic changed. Two comments stand out: _prope.py dropped the MIT-source URL and license callout for ported PRoPE math, which matters for traceability and any future third-party audit; vae.py lost the note about the Wan2.2_VAE.pth no-remap alternative. Neither affects runtime, but the attribution gap in _prope.py is the kind of thing that is easy to fix now and hard to recover later.

integrations/hy_worldplay/hy_worldplay/_prope.py (upstream attribution removed) and flashdreams/flashdreams/recipes/wan/autoencoder/vae.py (alternative checkpoint path no longer documented).

Important Files Changed

Filename Overview
flashdreams/flashdreams/recipes/wan/autoencoder/vae.py Comment-only trimming of the VAE key-remap block; the new header line labels the remap as "the production VAE load path," which is consistent with the default configs but silently drops the only mention of the Wan2.2_VAE.pth alternative.
integrations/hy_worldplay/hy_worldplay/_prope.py Module docstring compressed; removes the explicit credit and GitHub URL for the MIT-licensed hyvideo/prope/camera_rope.py source that was ported here, along with the test cross-check note.
integrations/hy_worldplay/hy_worldplay/_action.py Large volume of comment/docstring tightening; core logic, signatures, and assertions are unchanged.
integrations/hy_worldplay/hy_worldplay/_camera.py Docstrings and inline comments trimmed throughout; executable paths unaffected.
integrations/hy_worldplay/hy_worldplay/_checkpoint.py Block comments for the 4-step remap pipeline compressed; logic and key patterns unchanged.
integrations/hy_worldplay/hy_worldplay/_debug_dump.py Module docstring trimmed; removes mention of the vendor-side dump_patch.py parallel dump harness, which is purely informational.
integrations/hy_worldplay/hy_worldplay/_memory.py Module docstring and function docstrings trimmed; the assertion comment near select_memory_frame_indices drops the explanation that the greedy 4-frame-clip loop can overshoot fov_budget by up to 3.
integrations/hy_worldplay/hy_worldplay/_pose.py Minor docstring trimming in parse_pose_data; no functional change.
integrations/hy_worldplay/hy_worldplay/config.py Docstring and inline-comment tightening for the pipeline builder; logic and config values unchanged.
integrations/hy_worldplay/hy_worldplay/runner.py Runner docstrings, field docstrings, and inline comments trimmed; removes some "upstream's …" references but no functional change.
integrations/wan22/wan22/config.py Module docstring rewritten more concisely; description of TI2V mode is accurate and aligned with the code.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["_WAN22_TI2V_5B_VAE_KEY_REMAP dict\n(diffusers → flashdreams key map)"] --> B["wan22_ti2v_5b_vae_state_dict_transform()"]
    B --> C["Wan22TI2V5BVAEEncoderConfig\ndefault: WAN22_TI2V_5B_VAE_DIFFUSERS_PATH"]
    B --> D["Wan22TI2V5BVAEDecoderConfig\ndefault: WAN22_TI2V_5B_VAE_DIFFUSERS_PATH"]
    E["WAN22_TI2V_5B_VAE_PATH\nWan2.2_VAE.pth\n(no remap needed)"] -.->|"opt-in alternative\n(comment removed by this PR)"| C
    E -.-> D
    style E stroke-dasharray: 5 5
    style A fill:#ffe0b2
Loading

Reviews (1): Last reviewed commit: "docs(hy_worldplay/wan22): tighten AI-gen..." | Re-trigger Greptile

Comment on lines 17 to 20

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

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.

P1 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!

Comment thread flashdreams/flashdreams/recipes/wan/autoencoder/vae.py
Comment thread integrations/hy_worldplay/hy_worldplay/_memory.py

@liruilong940607 liruilong940607 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TY! Always love to see cleanups!

@liruilong940607

Copy link
Copy Markdown
Collaborator

/ok to test 6c58789

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