用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/shader-slang/slang-skills --skill slangpy-build命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Use whenever output will name a specific person: release notes, changelogs, contributor lists, commit or PR attribution, code comments, issue and review replies, docs credits, or any prose referring to a human. Governs where a name may come from and how to choose pronouns, so stale names from git history and gender guesses from model priors never reach the output.
Surface the open shader-slang PRs needing human attention with a bundled gh-only Python script (scripts/pr_report.py): an assignee-grouped escalation report computed entirely from live GitHub state (read-only; no writes; optional Discord/Slack mentions). Use for PR triage, the reviewer-attention report, stale-PR follow-up, or a scheduled report run.
Bridge from /slang-maintain workflow steps to concrete slang-mcp tool calls. Read-only except an optional, user-confirmed post of the generated daily report to Slack. Task recipes live in sibling files.
基于 SOC 职业分类
| name | slangpy-build |
| license | MIT |
| description | Clone, build, and test SlangPy. Use when the repo needs setup, a rebuild, or when tests fail. |
| provides | ["code.build","test.run","test.gen","ci.inspect"] |
| allowed-tools | Bash(git:*), Bash(cmake:*), Bash(python:*), Bash(pytest:*), Bash(pip:*), Bash(pre-commit:*), Read, Grep, Glob |
Check all of these before starting the build. Request any missing packages in a single install_packages call — the container will be rebuilt and you must restart the build from scratch after that, so identify everything upfront.
Required apt packages:
cmake, ninja-build — build systemlibgl-dev, libegl-dev — OpenGL/EGL headers (SlangPy/SGL requires these)libvulkan-dev — Vulkan headerslibx11-dev, libxext-dev, libxrandr-dev, libxinerama-dev, libxcursor-dev, libxi-dev — X11 display headersRequired Python packages (install via pip into the project venv after the build system is ready, not via install_packages):
numpy — required by SlangPypillow — required by testspytest — test runnerCheck:
# Check apt packages
for pkg in cmake ninja-build libgl-dev libegl-dev libvulkan-dev libx11-dev libxext-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev; do
dpkg -l "$pkg" 2>/dev/null | grep -q "^ii" || echo "MISSING: $pkg"
done
If any are missing, call install_packages with all of them at once before proceeding. After the container rebuilds, re-invoke this skill from scratch.
git clone --recursive --tags https://github.com/shader-slang/slangpy.git /workspace/agent/slangpy
cd /workspace/agent/slangpy
git remote add upstream https://github.com/shader-slang/slangpy.git
git fetch --tags upstream
SlangPy uses CMake presets for the native C++/nanobind layer. On Linux:
cmake --preset linux-gcc # Configure
cmake --build --preset linux-gcc-debug # Build (debug)
cmake --build --preset linux-gcc-release # Build (release)
cmake --preset linux-gcc --fresh # Reconfigure from scratch
Available presets: windows-msvc, windows-arm64-msvc, linux-gcc, macos-arm64-clang.
For Python editable install (preferred for development):
pip install -e .
Use python tools/ci.py configure and python tools/ci.py build for CI-style builds that handle platform detection automatically.
Always build before running tests.
# All Python tests
pytest slangpy/tests -v
# Example tests
pytest samples/tests -vra
# C++ unit tests
python tools/ci.py unit-test-cpp
# Specific test file
pytest slangpy/tests/slangpy_tests/test_X.py -v
# Specific test function
pytest slangpy/tests/slangpy_tests/test_X.py::test_fn -v
Debug generated shaders:
SLANGPY_PRINT_GENERATED_SHADERS=1 pytest slangpy/tests/slangpy_tests/test_X.py -v
CI runs via .github/workflows/ci.yml and calls tools/ci.py:
python tools/ci.py --help # All available commands
python tools/ci.py configure # CMake configure
python tools/ci.py build # Build
python tools/ci.py unit-test-python # Python tests
python tools/ci.py unit-test-cpp # C++ tests
python tools/ci.py test-examples # Example tests
To inspect CI failures:
gh run list --repo shader-slang/slangpy --workflow=ci.yml --limit 5
gh run view <run-id> --log-failed
Run pre-commit run --all-files before committing. Re-run if it modifies files. Uses Black for Python and clang-format for C++.
The functional API has a 3-phase call path. When debugging:
src/slangpy_ext/utils/slangpyfunction.cpp). Check NativeCallDataCache for signature string construction.slangpy/core/calldata.py). Check type resolution, vectorization dimensionality, generated kernel code.src/slangpy_ext/utils/slangpy.cpp). Check shape calculation, uniform binding, dispatch thread count.Set SLANGPY_PRINT_GENERATED_SHADERS=1 to see the Slang compute kernel source generated in Phase 2.
To test with a local Slang compiler build:
cmake --preset linux-gcc --fresh -DSGL_LOCAL_SLANG=ON -DSGL_LOCAL_SLANG_DIR=<slang-dir> -DSGL_LOCAL_SLANG_BUILD_DIR=build/Debug
cmake --build --preset linux-gcc-debug
-help, -target spirv.AGENTS.md -- 3-phase functional API architecture, build commands, test commands, debugging workflowCLAUDE.md -- references AGENTS.mdCONTRIBUTING.md -- build from source instructions, test workflowCMakeLists.txt -- CMake build system, presets, platform detectionpyproject.toml -- Python build config (setuptools + cmake + ninja)tools/ci.py -- CI task runner with configure, build, test, coverage commands