fix(jax): return stored HLO neighbor count#5792
Conversation
Derive HLO.get_nnei() from the serialized selection metadata through get_nsel() instead of reading an attribute that is never initialized. This restores the neighbor-width contract used by JAX serialization and export helpers. Add a focused metadata regression that avoids requiring generated StableHLO artifacts. Fixes deepmodeling#5669. Coding-Agent: Codex Codex-Version: codex-cli 0.144.1 Model: gpt-5.6-sol Reasoning-Effort: xhigh
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesJAX HLO neighbor count
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5792 +/- ##
==========================================
- Coverage 79.85% 79.57% -0.28%
==========================================
Files 1022 1022
Lines 117351 117350 -1
Branches 4313 4312 -1
==========================================
- Hits 93706 93386 -320
- Misses 22101 22407 +306
- Partials 1544 1557 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Why existing tests missed this
The constructor stores self.sel but never creates self.nsel. Existing consistency and model tests exercise neighbor counts on dpmodel, TensorFlow, and PyTorch wrappers, but no JAX test directly queried the HLO wrapper. Serialization and export helpers can therefore reach an AttributeError even though the broader model tests pass.
The new unit test isolates the metadata API without constructing real StableHLO byte artifacts, which are unrelated to this accessor.
Validation
Closes #5669.
Coding agent: Codex
Codex version: codex-cli 0.144.1
Model: gpt-5.6-sol
Reasoning effort: xhigh
Summary by CodeRabbit