rebuild-pyd

Rebuilds the astroray Python extension after deleting stale .pyd shadow copies.

Updated Dec 27, 2025
One-click install
npx skills add https://github.com/HendrikGC02/Astroray --skill rebuild-pyd-hendrikgc02
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rebuild-pyd
Source: https://github.com/HendrikGC02/Astroray/tree/main/.claude/skills/rebuild-pyd
Command: npx skills add https://github.com/HendrikGC02/Astroray --skill rebuild-pyd-hendrikgc02

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Stale astroray .pyd files outside the build directory silently shadow fresh builds on sys.path, so tests keep loading an old binary and code changes appear to have no effect. This Skill performs a canonical clean rebuild that finds and removes every shadow copy before compiling. ## Core Features & Use Cases - Shadow detection and removal: Locates every astroray*.pyd on disk, distinguishes legitimate build outputs from shadow copies, and deletes only the shadows after showing the list. - Three build variants: Supports standalone (windows-cpu-vs preset), cuda (windows-cuda-vs preset), and blender (build_blender_addon.py with OpenMP ON and bundled vcomp140.dll). - Post-build verification: Confirms the fresh artifact timestamp and smoke-tests that import astroray resolves inside build/ rather than the project root. - Use Case: A test fix appears to do nothing and failure output is identical to before the edit; run this Skill to clear the stale project-root .pyd, rebuild, and verify the new binary loads. ## Quick Start Ask the assistant to run /rebuild-pyd and specify whether you want the standalone, cuda, or blender variant rebuilt.

Frequently Asked Questions about rebuild-pyd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my tests ignore code changes after rebuilding a pybind11 extension?▼

A stale .pyd copy outside the build directory is shadowing the fresh binary on sys.path. The project-root copy wins because tests insert the project root after build/, so the old binary loads and produces frozen output.

How do I rebuild a pybind11 .pyd extension cleanly on Windows?▼

First enumerate every astroray*.pyd with Get-ChildItem, delete copies outside build/, build_cuda/, build_tcnn/, and the Blender staging directory, then rebuild with the appropriate CMake preset and verify the artifact timestamp is fresh.

Can the Blender addon build use OpenMP?▼

Yes, since issue #780 the Blender variant builds with OpenMP ON. The historic hang was a GIL/OpenMP circular wait fixed by releasing the GIL across the CPU render, and build_blender_addon.py bundles vcomp140.dll next to the .pyd.

How do I verify the correct .pyd is being imported?▼

Run python -c with sys.path inserting build/ first, import astroray, and print astroray.__file__. The printed path must be inside build/ or build_cuda/; if it points to the project root, a shadow copy was missed.

When should I not blindly delete all .pyd files?▼

Never run a recursive delete across the whole repo, because that removes the legitimate Blender addon staging copy in blender_addon/Release/ and the real build outputs. Only delete shadows at the project root, tests/, and non-staging Release/ paths.