Skip to content

feat: add full GLSL, HLSL, and shader build support#1352

Open
Hungbocluaqua wants to merge 4 commits into
colbymchenry:mainfrom
Hungbocluaqua:codex/full-shader-support
Open

feat: add full GLSL, HLSL, and shader build support#1352
Hungbocluaqua wants to merge 4 commits into
colbymchenry:mainfrom
Hungbocluaqua:codex/full-shader-support

Conversation

@Hungbocluaqua

Copy link
Copy Markdown

What changed

Adds first-class shader and shader-build intelligence across the CodeGraph pipeline:

  • GLSL and Vulkan GLSL support for standard, ray-tracing, mesh, task, and OpenUSD GLSLFX files
  • HLSL support for functions, overloads, semantics, attributes, resources, register/space coordinates, and RTXDI-style include contexts
  • pinned ABI-15 tree-sitter GLSL/HLSL grammars with reproducible provenance and third-party notices
  • shader preprocessing, macro declarations/references, transitive include resolution, conditional variants, and include-scoped call/resource matching
  • shader resources including uniform/storage blocks, push constants, specialization constants, payloads, hit attributes, descriptor coordinates, and Vulkan attributes
  • conservative C/C++ to shader file, entry-point, descriptor, specialization, push-constant, and vertex-location relationships
  • CMake and PowerShell build-script indexing, including module imports, dot-sourcing, cross-script calls, shader variants, and SPIR-V references
  • target-scoped shader callers, impact, affected-test discovery, and explore output with file/line disambiguation
  • C++ local lambda extraction and scope recovery needed by Vulkan resource-building code
  • documentation, language artwork, configuration guidance, corpus tooling, and regression coverage

Why

Shader-heavy C++ projects currently lose their dependency graph at the CPU/GPU and build-system boundaries. This makes source lookup useful but leaves callers, impact, affected tests, descriptor ownership, compilation targets, and application-specific shader bridge implementations incomplete or ambiguous.

The implementation was developed against a Vulkan ray-tracing engine and NVIDIA RTXDI, with repeated regression testing for overloads, conditional macros, include contexts, application bridges, shader entry points, PowerShell modules, CMake variants, and C++ pipeline ownership.

References the language roadmap in #648 and the original GLSL request in #685. The closed #688 PR was used only as a regression reference; this implementation is based directly on current main.

Validation

  • npm run build
  • package dry run: 750 packaged files; both GLSL/HLSL WASM grammars and THIRD_PARTY_NOTICES.md present
  • focused explore/disambiguation sweep: 81/81 tests passed
  • changed-area sweep: 650/651 tests passed; the sole failure was a Windows EBUSY cleanup of a temporary uninitialized-submodule directory
  • post-fix dynamic/shader sweep: 58/58 tests passed
  • Vulkan corpus: 227 shader-family files parsed twice deterministically, expected 99 first-party GLSL files, zero extraction failures
  • RTXDI corpus: 282 shader-family files parsed twice deterministically, zero extraction failures
  • real-index probes confirm exact main -> trace_path and main -> RTXDI_DITemporalResampling Flow, Relationships, caller source, and callee source

The full Windows pre-push suite also exposed existing Windows file-lock/global-hook-path failures in temporary MCP, worktree, SQLite, ArkTS, and git-hook tests. One genuine dynamic-dispatch labeling regression found in that run was fixed in the final commit and covered by the 58-test post-fix sweep. Docker Desktop's Linux daemon was unavailable locally, so this draft relies on GitHub CI for the authoritative clean Linux full-suite result.

Review notes

This is intentionally a draft because the implementation spans language extraction, resolution, graph traversal, retrieval, and build integration. The commits are organized as implementation/tests, documentation/evaluation assets, and a final dynamic-dispatch precision fix. I am happy to split the draft into a staged PR series if that is easier to review.

…port

# Conflicts:
#	CHANGELOG.md
#	src/extraction/grammars.ts
#	src/extraction/tree-sitter.ts
#	src/mcp/tools.ts
#	src/resolution/callback-synthesizer.ts
#	src/resolution/import-resolver.ts
#	src/resolution/index.ts
@Hungbocluaqua
Hungbocluaqua marked this pull request as ready for review July 18, 2026 05:35
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.

1 participant