vxpu/kernels: collapse per-op registration, catalog, and Go equivalence test boilerplate #967
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #967"
general
weight: 0.35
justinsb
vxpu/kernels: read kernel metadata from canonical kernel_catalog.json
Adding a new kernel previously required duplicating devices, numerics, lowerability, SiteKind, applicability conditions, and preference order across
plan.OP_KINDS, Python@implementation/@variantdecorators,ops.SELECTION,pyrightconfig.json, andpkg/kernelplan/catalog/kernel_catalog.json.Makes
vxpu/pkg/kernelplan/catalog/kernel_catalog.jsonthe single source of truth shared by Go and Python:plan.OP_KINDSand loads body metadata and preference order directly fromkernel_catalog.jsoninplan.implementation(), validating that any explicit arguments do not contradict the catalog.kernel_catalog.jsonalongsidevxpu/invxpu/images/executor/Dockerfile.@implementationcalls inops.pyand@variantcalls undervxpu/python/vxpu/kernels/(includingfused_add_rmsnorm,fused_qk_norm_rope, andmoe_topk_softmax), and sorts module discovery inkernels.discover().ops.default_context(),ops.context(), andops.NoTensorContextErrorso standard activation-first ops derive row counts and<rows>x<K>shape keys generically; removes_int4_linear_context,_int4_moe_context,_int4_moe_swiglu_context,_fused_add_rmsnorm_context, and_moe_topk_softmax_context; lowers any op registered inplan.REGISTRYwithout requiring aSELECTIONentry; and updateskernel_tools/score.pyto derive scoring context viaops.context().pyrightconfig.jsonto ignorevxpu/kernels/**/_triton_kernel.pyand updates the pinnedkernel_digestinlower_test.pyfor the simplifiedgpu_triton.pydecorators.vxpu/kernelplan: extract call-site rows and shapes generically
Previously
segment.gohardcodedvxpu::int4_linear,vxpu::int4_moe,vxpu::int4_moe_swiglu,vxpu::fused_add_rmsnorm,vxpu::fused_qk_norm_rope, andvxpu::moe_topk_softmaxto extract row counts and shapes from exported tensor metadata, forcing every new fused op to add another branch.Replaces the hardcoded branch with
populateCallSiteShapes(), which derives row counts from the leading dimensions of the primary activation tensor (namedxor the first tensor input) and records a default<rows>x<K>shape string when not already populated from weight metadata. Only operators with non-standard signatures (rotary,hc_sinkhorn,engram_rows,allreduce,read,fused_qk_norm_rope,moe_experts, andfp8_grouped_linear) keep explicit overrides.vxpu/planner: make Go GPU equivalence tests data-driven
Previously each new lowerable GPU op required a dedicated
TestVerifyPlanEquivalence_GPU_<Op>function inequivalence_test.goand a matchinggrepassertion indev/ci/gpu/test-vxpu-gpu.Replaces the per-op GPU tests with
TestVerifyPlanEquivalence_GPU_LowerableOps, which reads call sites from the exported fixture artifact, intersects them with lowerable CUDA bodies inDefaultKernelCatalog(), and verifies reference vs optimized equivalence, observed bodies, and timing for every discovered op. Updatesdev/ci/gpu/test-vxpu-gputo verify the data-driven suite without per-opgreplines, and updatesvxpu/docs/design.mdwith the shared catalog and generic extraction architecture.Verified on NVIDIA L4 (driver 580.178.04, 23034 MiB, torch 2.14.1+cu130):
Fixes #966