Skip to content

♻️ Streamline ROMEO kernels and ship MIT notice with binaries#22

Merged
vanandrew merged 2 commits into
mainfrom
perf/romeo-weight-loop
Apr 25, 2026
Merged

♻️ Streamline ROMEO kernels and ship MIT notice with binaries#22
vanandrew merged 2 commits into
mainfrom
perf/romeo-weight-loop

Conversation

@vanandrew

@vanandrew vanandrew commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Summary

Two related but distinct cleanups on the ROMEO port. Split into separate commits so either can be reverted in isolation.

:recycle: Streamline weight + voxel_quality kernels

  • weights.hcalculate_weights_romeo_impl rewritten as a single (k, j, i) pass over voxels. Boundary edges are skipped by construction (i+1<nx, j+1<ny, k+1<nz) instead of being computed then zeroed in a trailing pass. The masked_mag full-volume copy is replaced by an inline mag_at lambda — no shadow buffer. The dead maxmag block left over for unported flags 5-6 is gone.
  • voxel_quality.h — the four full-volume passes (forward sum + three backward axis sweeps + divide-by-6) are fused into one (k, j, i) loop with the same left-to-right associativity as the original.

Per-edge FP arithmetic is unchanged, so the ROMEO goldens remain bit-exact. All 207 tests pass.

:wrench: Ship ROMEO MIT notice with binary distributions

include/romeo/ is a port of MIT-licensed code, so the notice has to travel with anything binary, not just the source tree. Today it travels with the headers (sdist / git checkout fine) but not with wheels or the standalone wk-* bundles.

  • pyproject.toml: declare license-files = ["LICENSE", "include/romeo/LICENSE"] (PEP 639). Verified via uv build --sdist — PKG-INFO emits both files as License-File: entries, so wheels also carry them under *.dist-info/licenses/.
  • packaging/pyinstaller/build_bundle.py: drop both LICENSE files into a LICENSES/ directory inside each standalone bundle.
  • bundle_README.md: point users at LICENSES/.

Dockerfile is unchanged — ADD . /opt/warpkit already ships both notices in the image.

Test plan

  • uv sync --group dev --reinstall-package warpkit — clean rebuild
  • uv run pytest -q — 207/207 pass
  • uv build --sdist — sdist builds, License-File: metadata for both files present in PKG-INFO
  • CI wheel matrix (cp311–cp314 × linux/macos)
  • Spot-check a built wheel for *.dist-info/licenses/include/romeo/LICENSE
  • Next standalone-binary release: confirm LICENSES/warpkit.LICENSE and LICENSES/ROMEO.LICENSE land inside the bundle zip

🤖 Generated with Claude Code

vanandrew and others added 2 commits April 25, 2026 17:02
Refactor calculate_weights_romeo_impl into a single (k, j, i) pass over
voxels: skip boundary edges by construction (i+1<nx, j+1<ny, k+1<nz)
instead of computing then zeroing them, drop the masked_mag full-volume
copy in favor of an inline mag_at lambda, and remove the dead maxmag
block left over for unported flags 5-6. Per-edge FP arithmetic is
unchanged so the ROMEO goldens remain bit-exact.

Fuse the four full-volume passes in voxel_quality (forward sum + three
backward axis sweeps + divide-by-6) into a single (k, j, i) loop with
the same left-to-right associativity as the original.

207 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The ROMEO C++ port under include/romeo/ is a derivative of MIT-licensed
code, so the notice has to travel with binary distributions, not just
the source tree.

- pyproject.toml: declare license-files = [LICENSE, include/romeo/LICENSE]
  (PEP 639). Verified via `uv build --sdist` that PKG-INFO emits both
  files as License-File entries, so wheels also carry them under
  *.dist-info/licenses/.
- packaging/pyinstaller/build_bundle.py: drop both files into a LICENSES/
  directory inside each standalone bundle.
- bundle_README.md: point users at LICENSES/.

The Dockerfile already copies the full source tree (ADD . /opt/warpkit)
so both notices ship in the image untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 25, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the ROMEO C++ port by reducing redundant full-volume passes in the weight/voxel-quality kernels, and ensures ROMEO’s upstream MIT notice is included in binary distributions (wheels + PyInstaller bundles) alongside warpkit’s license.

Changes:

  • Add PEP 639 license-files metadata so wheels include both LICENSE and include/romeo/LICENSE.
  • Add bundling of both license notices into standalone PyInstaller bundles under LICENSES/ and document their location.
  • Refactor ROMEO weights and voxel_quality kernels to fuse/streamline passes while preserving intended boundary behavior via loop guards.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Adds PEP 639 license-files to ship ROMEO + warpkit license texts in wheels/sdists.
packaging/pyinstaller/build_bundle.py Copies both license files into LICENSES/ within standalone bundles.
packaging/pyinstaller/bundle_README.md Documents where bundled licenses live for end users.
include/romeo/weights.h Rewrites weight computation into a single voxel-order pass and removes shadow buffers/trailing boundary zeroing.
include/romeo/voxel_quality.h Fuses multiple sweeps into a single pass computing forward+backward contributions per voxel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Apr 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.42%. Comparing base (cb14414) to head (7f8eddf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #22   +/-   ##
=======================================
  Coverage   95.42%   95.42%           
=======================================
  Files          15       15           
  Lines        1071     1071           
=======================================
  Hits         1022     1022           
  Misses         49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vanandrew vanandrew merged commit 3a7a96b into main Apr 25, 2026
28 checks passed
@vanandrew vanandrew deleted the perf/romeo-weight-loop branch April 25, 2026 22:13
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