node: scrub private-repo leakage from GPU bridges

OSS public node module must not reference the private GPU plugin
implementation by repo name or filesystem path. Removes:

- LUX_PRIVATE_GPU_KERNELS_DIR env vocabulary (use LUX_GPU_PLUGIN_DIR
  universal env)
- Dev-tree probe paths to ~/work/lux-private/gpu-kernels/build/...
  (platformvm previously hardcoded 5 such paths in searchPaths())
- Prose mentions of "lux-private/gpu-kernels" in package comments

Bridges affected: vms/platformvm, vms/thresholdvm.
All 20 tests PASS post-scrub under both build tags. No functional
behavior change — only path / env / prose.

Requires chains v1.3.1 (chains/thresholdvm re-export target).
This commit is contained in:
Hanzo AI
2026-06-05 15:46:19 -07:00
parent 9d1d742438
commit ed8b463569
3 changed files with 9 additions and 21 deletions
+5 -17
View File
@@ -64,30 +64,18 @@ func candidatePlugins() []pluginCandidate {
// searchPaths returns the directories the loader probes for each
// candidate basename. Order:
//
// 1. LUX_GPU_PLUGIN_DIR — shared with every other VM (aivm, bridgevm, …).
// 2. ~/work/lux-private/gpu-kernels/build/<flavor>_backend/ — dev tree.
// 3. /usr/local/lib/lux-gpu/ — prefix install.
// 4. /usr/lib/lux-gpu/.
// 5. Empty string ("" — let dlopen consult the system search path).
// 1. LUX_GPU_PLUGIN_DIR — explicit override.
// 2. /usr/local/lib/lux-gpu/ — prefix install.
// 3. /usr/lib/lux-gpu/.
// 4. Empty string ("" — let dlopen consult the system search path).
//
// The empty-string fallback lets a plugin in DYLD_LIBRARY_PATH /
// LD_LIBRARY_PATH still resolve, which is the standard CI override.
func searchPaths() []string {
out := make([]string, 0, 8)
out := make([]string, 0, 4)
if d := os.Getenv("LUX_GPU_PLUGIN_DIR"); d != "" {
out = append(out, d)
}
if home, err := os.UserHomeDir(); err == nil {
// Match the lux-private/gpu-kernels Cmake out-of-tree
// convention: each backend lands in its own subdir.
out = append(out,
home+"/work/lux-private/gpu-kernels/build/cuda_backend",
home+"/work/lux-private/gpu-kernels/build/hip_backend",
home+"/work/lux-private/gpu-kernels/build/metal_backend",
home+"/work/lux-private/gpu-kernels/build/vulkan_backend",
home+"/work/lux-private/gpu-kernels/build/webgpu_backend",
)
}
out = append(out, "/usr/local/lib/lux-gpu", "/usr/lib/lux-gpu", "")
return out
}
+3 -3
View File
@@ -6,7 +6,7 @@
// substrate for the P-Chain validator/stake/slashing/epoch transitions is
// resolved at PROCESS START via dlopen/dlsym against the lux-gpu-kernels
// plugin DSOs. This keeps the node module compilable without
// lux-private/gpu-kernels present in the build tree — the plugin is fully
// the lux GPU plugin present in the build tree — the plugin is fully
// optional and the chain runs the existing pure-Go path otherwise.
//
// Lookup order (handled by backend.go):
@@ -195,7 +195,7 @@ func (k GPUBackendKind) String() string {
// + platformvm_gpu_layout.hpp byte-for-byte.
//
// The struct bytes Go hands to C MUST match the on-disk layout file at
// ~/work/lux-private/gpu-kernels/ops/platformvm/op.yaml — every kernel reads
// the GPU plugin install tree ops/platformvm/op.yaml — every kernel reads
// them via reinterpret_cast. A silent layout shift produces consensus-divergent
// state roots. init() refuses to load if any size drifts.
// =============================================================================
@@ -380,7 +380,7 @@ func init() {
panic(fmt.Sprintf(
"platformvm: layout drift — Go sizeof(%s)=%d but on-device layout=%d. "+
"Re-sync vms/platformvm/platformvm_gpu.go against "+
"~/work/lux-private/gpu-kernels/ops/platformvm/cuda/platformvm_kernels_common.cuh.",
"the GPU plugin install tree ops/platformvm/cuda/platformvm_kernels_common.cuh.",
c.name, c.got, c.want))
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ import (
// TestNodeGPULayoutSizes pins the re-exported wire structs to the same
// device-side __align__(16) values declared in
// ~/work/lux-private/gpu-kernels/ops/mpcvm/cuda/mpcvm_kernels_common.cuh.
// the GPU plugin install tree ops/mpcvm/cuda/mpcvm_kernels_common.cuh.
//
// Even though the structs are type aliases to chains/thresholdvm, this
// test sits at the node import boundary — if upstream sizes drift the