24 gpu 04 gpu gpu public path launch pool emit entry - #25
Merged
Conversation
Process-lifetime launch command pool with per-job CB and fence checkout/return under mutex; stop creating a command pool per launch.
Complete the Vulkan GPU user path on top of LaunchEngine: vendored glslang SPIR-V, Signature/codegen, ShaderCache register, resident-aware prepare after shutdown, lists-only bindings, list[bool] marshal, and broad unit/pipeline coverage.
Owner
Author
|
DEVELOPER NOTE: Testing the gpu features does NOT work on github. Any changes must be tested locally and (ideally) be verified on > 2 devices. |
Introduce process-wide GpuState and Python GpuArena so bound lists stay on device across launches. Support join(download=False), borrow resident buffers in launch, and skip GLSL compile tests on GitHub Actions.
K-T0BIAS
merged commit Sep 16, 2026
4748d8f
into
4-native-gpu-support-cthreads-for-vulkanspir-v
2 checks passed
K-T0BIAS
deleted the
24-gpu-04-gpu-gpu-public-path-launch-pool-emit-entry_
branch
September 16, 2026 19:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the public Vulkan
@Gpu/gpu()path (GPU-04) on top of the existingcontext, GpuPack, ShaderCache, and LaunchEngine work. Users can decorate kernels,
prepare()/compile(), launch withgpu(...).join(), and get in-place listwriteback. Includes codegen->SPIR-V, broad tests
Features
@Gpudecorator: validate annotations (int/float/bool,list[...]),attach kernel meta, register for compile; requires
CTHREADS_GPU+ deviceprepare()/compile()/gpu()/GpuJob: emit SPIR-V, register inShaderCache, launch, fence-wait, write lists back;
shutdown()clears theprepared flag so the next prepare re-registers shaders
Syntax lowering (assign/flow/ops/indexes);
GlobalIdx/ThreadIdx/ etc.;math.sqrt-> GLSLsqrt; assemble#version+maincompile_glsl); glslc CLI fallback; clearercompile errors (reserved GLSL identifier hint)
binding_count = (scalars ? 1 : 0) + lists; listsstart at binding 0 when there are no scalars (C++ launch + descriptors match)
list[bool]: std430 4-byte 0/1 upload + writeback (same as scalar bool)ceil(n / local_size_x)with default workgroup size 64__sync_threads(not grid-wide)Modules / layout
Python (
cthreads.gpu)runtime.py:prepare,compile,gpu,GpuJob(not namedprepare.py,so the callable does not shadow a submodule)
_ext_gpu_api.py: bridge tocthreads._ext.gpufrontend/:@Gpu, indexes, errors,available/init/shutdowngpu_kernel_meta.py/gpu_marshal.py: launch meta + arg / group_count helperscompiler/translation/: Glsl, Signature, context, result, assemble, spirv,translate;
syntax/(Name, Index, Op, Assign, Flow, Syntax);plugins/(indexes, math_calls)
compiler/orchestrator/:GpuCompileSession,GpuUnit(emit + register)third_party_notices/: glslang notices; rootLICENSEupdatedC++ (
src/cthreads/cpp/gpu,CTHREADS_GPU=ON)compile_glsl.cpp: vendored glslang linked into_extmodule.cpp/descriptors.cpp: lists-only bindings;list[bool]marshalcompile_glsl,register_shader, launch path updatesTests
kernel_meta, errors, decorator, reserved names, prepare
tests/helpers_gpu.py