Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-gpu

Source of release 0.5.2

0.5.2 / tests / gpu / kernels.lucb

#==============================================================================================
#
#   kernels - Embedded GPU shaders
#
#   DESCRIPTION:
#       Generated by luce-gpu/tools/embed_shaders.py from saxpy.comp, reduce.comp, compact.comp, arguments.comp, double.comp, image_write.comp, image_accumulate.comp, float_sum.comp, ieee.comp, subgroup.comp, addresses.comp, table.comp, rays.comp, special.comp; do not edit.
#
#==============================================================================================

import c

# mark: saxpy: compute kernel =================================================================

pub let saxpy_comp_words: u32[385] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000038, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x0009000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000014, 0x00000021,
    0x0000002a, 0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001, 0x00030003,
    0x00000002, 0x000001c2, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005, 0x00000008,
    0x00000069, 0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69,
    0x00000044, 0x00040005, 0x00000012, 0x61726150, 0x0000736d, 0x00040006, 0x00000012, 0x00000000,
    0x00000061, 0x00040006, 0x00000012, 0x00000001, 0x0000006e, 0x00040005, 0x00000014, 0x61726170,
    0x0000736d, 0x00030005, 0x0000001f, 0x00000059, 0x00040006, 0x0000001f, 0x00000000, 0x00000079,
    0x00030005, 0x00000021, 0x00000000, 0x00030005, 0x00000028, 0x00000058, 0x00040006, 0x00000028,
    0x00000000, 0x00000078, 0x00030005, 0x0000002a, 0x00000000, 0x00040047, 0x0000000b, 0x0000000b,
    0x0000001c, 0x00030047, 0x00000012, 0x00000002, 0x00050048, 0x00000012, 0x00000000, 0x00000023,
    0x00000000, 0x00050048, 0x00000012, 0x00000001, 0x00000023, 0x00000004, 0x00040047, 0x0000001e,
    0x00000006, 0x00000004, 0x00030047, 0x0000001f, 0x00000002, 0x00050048, 0x0000001f, 0x00000000,
    0x00000023, 0x00000000, 0x00040047, 0x00000021, 0x00000021, 0x00000001, 0x00040047, 0x00000021,
    0x00000022, 0x00000000, 0x00040047, 0x00000027, 0x00000006, 0x00000004, 0x00030047, 0x00000028,
    0x00000002, 0x00040048, 0x00000028, 0x00000000, 0x00000018, 0x00050048, 0x00000028, 0x00000000,
    0x00000023, 0x00000000, 0x00030047, 0x0000002a, 0x00000018, 0x00040047, 0x0000002a, 0x00000021,
    0x00000000, 0x00040047, 0x0000002a, 0x00000022, 0x00000000, 0x00040047, 0x00000037, 0x0000000b,
    0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006,
    0x00000020, 0x00000000, 0x00040020, 0x00000007, 0x00000007, 0x00000006, 0x00040017, 0x00000009,
    0x00000006, 0x00000003, 0x00040020, 0x0000000a, 0x00000001, 0x00000009, 0x0004003b, 0x0000000a,
    0x0000000b, 0x00000001, 0x0004002b, 0x00000006, 0x0000000c, 0x00000000, 0x00040020, 0x0000000d,
    0x00000001, 0x00000006, 0x00030016, 0x00000011, 0x00000020, 0x0004001e, 0x00000012, 0x00000011,
    0x00000006, 0x00040020, 0x00000013, 0x00000009, 0x00000012, 0x0004003b, 0x00000013, 0x00000014,
    0x00000009, 0x00040015, 0x00000015, 0x00000020, 0x00000001, 0x0004002b, 0x00000015, 0x00000016,
    0x00000001, 0x00040020, 0x00000017, 0x00000009, 0x00000006, 0x00020014, 0x0000001a, 0x0003001d,
    0x0000001e, 0x00000011, 0x0003001e, 0x0000001f, 0x0000001e, 0x00040020, 0x00000020, 0x0000000c,
    0x0000001f, 0x0004003b, 0x00000020, 0x00000021, 0x0000000c, 0x0004002b, 0x00000015, 0x00000022,
    0x00000000, 0x00040020, 0x00000024, 0x00000009, 0x00000011, 0x0003001d, 0x00000027, 0x00000011,
    0x0003001e, 0x00000028, 0x00000027, 0x00040020, 0x00000029, 0x0000000c, 0x00000028, 0x0004003b,
    0x00000029, 0x0000002a, 0x0000000c, 0x00040020, 0x0000002c, 0x0000000c, 0x00000011, 0x0004002b,
    0x00000006, 0x00000035, 0x00000040, 0x0004002b, 0x00000006, 0x00000036, 0x00000001, 0x0006002c,
    0x00000009, 0x00000037, 0x00000035, 0x00000036, 0x00000036, 0x00050036, 0x00000002, 0x00000004,
    0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x00000007, 0x00000008, 0x00000007,
    0x00050041, 0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c, 0x0004003d, 0x00000006, 0x0000000f,
    0x0000000e, 0x0003003e, 0x00000008, 0x0000000f, 0x0004003d, 0x00000006, 0x00000010, 0x00000008,
    0x00050041, 0x00000017, 0x00000018, 0x00000014, 0x00000016, 0x0004003d, 0x00000006, 0x00000019,
    0x00000018, 0x000500b0, 0x0000001a, 0x0000001b, 0x00000010, 0x00000019, 0x000300f7, 0x0000001d,
    0x00000000, 0x000400fa, 0x0000001b, 0x0000001c, 0x0000001d, 0x000200f8, 0x0000001c, 0x0004003d,
    0x00000006, 0x00000023, 0x00000008, 0x00050041, 0x00000024, 0x00000025, 0x00000014, 0x00000022,
    0x0004003d, 0x00000011, 0x00000026, 0x00000025, 0x0004003d, 0x00000006, 0x0000002b, 0x00000008,
    0x00060041, 0x0000002c, 0x0000002d, 0x0000002a, 0x00000022, 0x0000002b, 0x0004003d, 0x00000011,
    0x0000002e, 0x0000002d, 0x00050085, 0x00000011, 0x0000002f, 0x00000026, 0x0000002e, 0x0004003d,
    0x00000006, 0x00000030, 0x00000008, 0x00060041, 0x0000002c, 0x00000031, 0x00000021, 0x00000022,
    0x00000030, 0x0004003d, 0x00000011, 0x00000032, 0x00000031, 0x00050081, 0x00000011, 0x00000033,
    0x0000002f, 0x00000032, 0x00060041, 0x0000002c, 0x00000034, 0x00000021, 0x00000022, 0x00000023,
    0x0003003e, 0x00000034, 0x00000033, 0x000200f9, 0x0000001d, 0x000200f8, 0x0000001d, 0x000100fd,
    0x00010038,
]

pub let saxpy_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct Params\n{\n    float a;\n    uint n;\n};\n\nstruct Y\n{\n    float y[1];\n};\n\nstruct X\n{\n    float x[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(constant Params& params [[buffer(30)]], device X& _42 [[buffer(0)]], device Y& _33 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    if (i < params.n)\n    {\n        _33.y[i] = (params.a * _42.x[i]) + _33.y[i];\n    }\n}\n\n"
pub let saxpy_comp_group: u32[3] = [64, 1, 1]
pub let saxpy_comp_bindings: u8[16] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let saxpy_comp_fast_math: bool = false
pub let saxpy_comp_table: bool = false

# mark: reduce: compute kernel ================================================================

pub let reduce_comp_words: u32[312] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000030, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x0008000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000013, 0x00000020,
    0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001, 0x00030003, 0x00000002,
    0x000001c2, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005, 0x00000008, 0x00000069,
    0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044,
    0x00040005, 0x00000011, 0x61726150, 0x0000736d, 0x00060006, 0x00000011, 0x00000000, 0x666c6168,
    0x756f635f, 0x0000746e, 0x00040005, 0x00000013, 0x61726170, 0x0000736d, 0x00040005, 0x0000001e,
    0x756c6156, 0x00007365, 0x00050006, 0x0000001e, 0x00000000, 0x756c6176, 0x00007365, 0x00030005,
    0x00000020, 0x00000000, 0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00030047, 0x00000011,
    0x00000002, 0x00050048, 0x00000011, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x0000001d,
    0x00000006, 0x00000004, 0x00030047, 0x0000001e, 0x00000002, 0x00050048, 0x0000001e, 0x00000000,
    0x00000023, 0x00000000, 0x00040047, 0x00000020, 0x00000021, 0x00000000, 0x00040047, 0x00000020,
    0x00000022, 0x00000000, 0x00040047, 0x0000002f, 0x0000000b, 0x00000019, 0x00020013, 0x00000002,
    0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020,
    0x00000007, 0x00000007, 0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020,
    0x0000000a, 0x00000001, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b,
    0x00000006, 0x0000000c, 0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x0003001e,
    0x00000011, 0x00000006, 0x00040020, 0x00000012, 0x00000009, 0x00000011, 0x0004003b, 0x00000012,
    0x00000013, 0x00000009, 0x00040015, 0x00000014, 0x00000020, 0x00000001, 0x0004002b, 0x00000014,
    0x00000015, 0x00000000, 0x00040020, 0x00000016, 0x00000009, 0x00000006, 0x00020014, 0x00000019,
    0x0003001d, 0x0000001d, 0x00000006, 0x0003001e, 0x0000001e, 0x0000001d, 0x00040020, 0x0000001f,
    0x0000000c, 0x0000001e, 0x0004003b, 0x0000001f, 0x00000020, 0x0000000c, 0x00040020, 0x00000026,
    0x0000000c, 0x00000006, 0x0004002b, 0x00000006, 0x0000002d, 0x00000040, 0x0004002b, 0x00000006,
    0x0000002e, 0x00000001, 0x0006002c, 0x00000009, 0x0000002f, 0x0000002d, 0x0000002e, 0x0000002e,
    0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b,
    0x00000007, 0x00000008, 0x00000007, 0x00050041, 0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c,
    0x0004003d, 0x00000006, 0x0000000f, 0x0000000e, 0x0003003e, 0x00000008, 0x0000000f, 0x0004003d,
    0x00000006, 0x00000010, 0x00000008, 0x00050041, 0x00000016, 0x00000017, 0x00000013, 0x00000015,
    0x0004003d, 0x00000006, 0x00000018, 0x00000017, 0x000500b0, 0x00000019, 0x0000001a, 0x00000010,
    0x00000018, 0x000300f7, 0x0000001c, 0x00000000, 0x000400fa, 0x0000001a, 0x0000001b, 0x0000001c,
    0x000200f8, 0x0000001b, 0x0004003d, 0x00000006, 0x00000021, 0x00000008, 0x0004003d, 0x00000006,
    0x00000022, 0x00000008, 0x00050041, 0x00000016, 0x00000023, 0x00000013, 0x00000015, 0x0004003d,
    0x00000006, 0x00000024, 0x00000023, 0x00050080, 0x00000006, 0x00000025, 0x00000022, 0x00000024,
    0x00060041, 0x00000026, 0x00000027, 0x00000020, 0x00000015, 0x00000025, 0x0004003d, 0x00000006,
    0x00000028, 0x00000027, 0x00060041, 0x00000026, 0x00000029, 0x00000020, 0x00000015, 0x00000021,
    0x0004003d, 0x00000006, 0x0000002a, 0x00000029, 0x00050080, 0x00000006, 0x0000002b, 0x0000002a,
    0x00000028, 0x00060041, 0x00000026, 0x0000002c, 0x00000020, 0x00000015, 0x00000021, 0x0003003e,
    0x0000002c, 0x0000002b, 0x000200f9, 0x0000001c, 0x000200f8, 0x0000001c, 0x000100fd, 0x00010038,
]

pub let reduce_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct Params\n{\n    uint half_count;\n};\n\nstruct Values\n{\n    uint values[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(constant Params& params [[buffer(30)]], device Values& _32 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    if (i < params.half_count)\n    {\n        _32.values[i] += _32.values[i + params.half_count];\n    }\n}\n\n"
pub let reduce_comp_group: u32[3] = [64, 1, 1]
pub let reduce_comp_bindings: u8[16] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let reduce_comp_fast_math: bool = false
pub let reduce_comp_table: bool = false

# mark: compact: compute kernel ===============================================================

pub let compact_comp_words: u32[593] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000050, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x000a000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000013, 0x00000022,
    0x00000030, 0x00000036, 0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001,
    0x00030003, 0x00000002, 0x000001c2, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005,
    0x00000008, 0x00000069, 0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f,
    0x496e6f69, 0x00000044, 0x00040005, 0x00000011, 0x61726150, 0x0000736d, 0x00040006, 0x00000011,
    0x00000000, 0x0000006e, 0x00040005, 0x00000013, 0x61726170, 0x0000736d, 0x00040005, 0x0000001e,
    0x756c6176, 0x00000065, 0x00040005, 0x00000020, 0x75706e49, 0x00000074, 0x00050006, 0x00000020,
    0x00000000, 0x756c6176, 0x00007365, 0x00030005, 0x00000022, 0x00000000, 0x00040005, 0x0000002d,
    0x746f6c73, 0x00000000, 0x00050005, 0x0000002e, 0x6e756f43, 0x73726574, 0x00000000, 0x00050006,
    0x0000002e, 0x00000000, 0x6e756f63, 0x00000074, 0x00060006, 0x0000002e, 0x00000001, 0x6c616d73,
    0x7473656c, 0x00000000, 0x00050006, 0x0000002e, 0x00000002, 0x6772616c, 0x00747365, 0x00050006,
    0x0000002e, 0x00000003, 0x7473616c, 0x00000000, 0x00050006, 0x0000002e, 0x00000004, 0x70617773,
    0x00646570, 0x00050005, 0x00000030, 0x6e756f63, 0x73726574, 0x00000000, 0x00040005, 0x00000034,
    0x7470654b, 0x00000000, 0x00050006, 0x00000034, 0x00000000, 0x7470656b, 0x00000000, 0x00030005,
    0x00000036, 0x00000000, 0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00030047, 0x00000011,
    0x00000002, 0x00050048, 0x00000011, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x0000001f,
    0x00000006, 0x00000004, 0x00030047, 0x00000020, 0x00000002, 0x00040048, 0x00000020, 0x00000000,
    0x00000018, 0x00050048, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000022,
    0x00000018, 0x00040047, 0x00000022, 0x00000021, 0x00000000, 0x00040047, 0x00000022, 0x00000022,
    0x00000000, 0x00030047, 0x0000002e, 0x00000002, 0x00050048, 0x0000002e, 0x00000000, 0x00000023,
    0x00000000, 0x00050048, 0x0000002e, 0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x0000002e,
    0x00000002, 0x00000023, 0x00000008, 0x00050048, 0x0000002e, 0x00000003, 0x00000023, 0x0000000c,
    0x00050048, 0x0000002e, 0x00000004, 0x00000023, 0x00000010, 0x00040047, 0x00000030, 0x00000021,
    0x00000002, 0x00040047, 0x00000030, 0x00000022, 0x00000000, 0x00040047, 0x00000033, 0x00000006,
    0x00000004, 0x00030047, 0x00000034, 0x00000002, 0x00040048, 0x00000034, 0x00000000, 0x00000019,
    0x00050048, 0x00000034, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000036, 0x00000019,
    0x00040047, 0x00000036, 0x00000021, 0x00000001, 0x00040047, 0x00000036, 0x00000022, 0x00000000,
    0x00040047, 0x0000004f, 0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003,
    0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020, 0x00000007, 0x00000007,
    0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020, 0x0000000a, 0x00000001,
    0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b, 0x00000006, 0x0000000c,
    0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x0003001e, 0x00000011, 0x00000006,
    0x00040020, 0x00000012, 0x00000009, 0x00000011, 0x0004003b, 0x00000012, 0x00000013, 0x00000009,
    0x00040015, 0x00000014, 0x00000020, 0x00000001, 0x0004002b, 0x00000014, 0x00000015, 0x00000000,
    0x00040020, 0x00000016, 0x00000009, 0x00000006, 0x00020014, 0x00000019, 0x0003001d, 0x0000001f,
    0x00000006, 0x0003001e, 0x00000020, 0x0000001f, 0x00040020, 0x00000021, 0x0000000c, 0x00000020,
    0x0004003b, 0x00000021, 0x00000022, 0x0000000c, 0x00040020, 0x00000024, 0x0000000c, 0x00000006,
    0x0004002b, 0x00000006, 0x00000028, 0x00000001, 0x0007001e, 0x0000002e, 0x00000006, 0x00000014,
    0x00000014, 0x00000006, 0x00000006, 0x00040020, 0x0000002f, 0x0000000c, 0x0000002e, 0x0004003b,
    0x0000002f, 0x00000030, 0x0000000c, 0x0003001d, 0x00000033, 0x00000006, 0x0003001e, 0x00000034,
    0x00000033, 0x00040020, 0x00000035, 0x0000000c, 0x00000034, 0x0004003b, 0x00000035, 0x00000036,
    0x0000000c, 0x0004002b, 0x00000014, 0x0000003a, 0x00000001, 0x00040020, 0x0000003b, 0x0000000c,
    0x00000014, 0x0004002b, 0x00000014, 0x00000040, 0x00000002, 0x0004002b, 0x00000014, 0x00000045,
    0x00000003, 0x0004002b, 0x00000014, 0x00000049, 0x00000004, 0x0004002b, 0x00000006, 0x0000004e,
    0x00000040, 0x0006002c, 0x00000009, 0x0000004f, 0x0000004e, 0x00000028, 0x00000028, 0x00050036,
    0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x00000007,
    0x00000008, 0x00000007, 0x0004003b, 0x00000007, 0x0000001e, 0x00000007, 0x0004003b, 0x00000007,
    0x0000002d, 0x00000007, 0x00050041, 0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c, 0x0004003d,
    0x00000006, 0x0000000f, 0x0000000e, 0x0003003e, 0x00000008, 0x0000000f, 0x0004003d, 0x00000006,
    0x00000010, 0x00000008, 0x00050041, 0x00000016, 0x00000017, 0x00000013, 0x00000015, 0x0004003d,
    0x00000006, 0x00000018, 0x00000017, 0x000500ae, 0x00000019, 0x0000001a, 0x00000010, 0x00000018,
    0x000300f7, 0x0000001c, 0x00000000, 0x000400fa, 0x0000001a, 0x0000001b, 0x0000001c, 0x000200f8,
    0x0000001b, 0x000100fd, 0x000200f8, 0x0000001c, 0x0004003d, 0x00000006, 0x00000023, 0x00000008,
    0x00060041, 0x00000024, 0x00000025, 0x00000022, 0x00000015, 0x00000023, 0x0004003d, 0x00000006,
    0x00000026, 0x00000025, 0x0003003e, 0x0000001e, 0x00000026, 0x0004003d, 0x00000006, 0x00000027,
    0x0000001e, 0x000500c7, 0x00000006, 0x00000029, 0x00000027, 0x00000028, 0x000500aa, 0x00000019,
    0x0000002a, 0x00000029, 0x00000028, 0x000300f7, 0x0000002c, 0x00000000, 0x000400fa, 0x0000002a,
    0x0000002b, 0x0000002c, 0x000200f8, 0x0000002b, 0x00050041, 0x00000024, 0x00000031, 0x00000030,
    0x00000015, 0x000700ea, 0x00000006, 0x00000032, 0x00000031, 0x00000028, 0x0000000c, 0x00000028,
    0x0003003e, 0x0000002d, 0x00000032, 0x0004003d, 0x00000006, 0x00000037, 0x0000002d, 0x0004003d,
    0x00000006, 0x00000038, 0x0000001e, 0x00060041, 0x00000024, 0x00000039, 0x00000036, 0x00000015,
    0x00000037, 0x0003003e, 0x00000039, 0x00000038, 0x00050041, 0x0000003b, 0x0000003c, 0x00000030,
    0x0000003a, 0x0004003d, 0x00000006, 0x0000003d, 0x0000001e, 0x0004007c, 0x00000014, 0x0000003e,
    0x0000003d, 0x000700ec, 0x00000014, 0x0000003f, 0x0000003c, 0x00000028, 0x0000000c, 0x0000003e,
    0x00050041, 0x0000003b, 0x00000041, 0x00000030, 0x00000040, 0x0004003d, 0x00000006, 0x00000042,
    0x0000001e, 0x0004007c, 0x00000014, 0x00000043, 0x00000042, 0x000700ee, 0x00000014, 0x00000044,
    0x00000041, 0x00000028, 0x0000000c, 0x00000043, 0x00050041, 0x00000024, 0x00000046, 0x00000030,
    0x00000045, 0x0004003d, 0x00000006, 0x00000047, 0x0000001e, 0x000700e5, 0x00000006, 0x00000048,
    0x00000046, 0x00000028, 0x0000000c, 0x00000047, 0x000200f9, 0x0000002c, 0x000200f8, 0x0000002c,
    0x00050041, 0x00000024, 0x0000004a, 0x00000030, 0x00000049, 0x0004003d, 0x00000006, 0x0000004b,
    0x00000008, 0x00050080, 0x00000006, 0x0000004c, 0x0000004b, 0x00000028, 0x000900e6, 0x00000006,
    0x0000004d, 0x0000004a, 0x00000028, 0x0000000c, 0x0000000c, 0x0000004c, 0x0000000c, 0x000100fd,
    0x00010038,
]

pub let compact_comp_msl: c.str = "#pragma clang diagnostic ignored \"-Wunused-variable\"\n\n#include <metal_stdlib>\n#include <simd/simd.h>\n#include <metal_atomic>\n\nusing namespace metal;\n\nstruct Params\n{\n    uint n;\n};\n\nstruct Input\n{\n    uint values[1];\n};\n\nstruct Counters\n{\n    uint count;\n    int smallest;\n    int largest;\n    uint last;\n    uint swapped;\n};\n\nstruct Kept\n{\n    uint kept[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(constant Params& params [[buffer(30)]], device Input& _34 [[buffer(0)]], device Kept& _54 [[buffer(1)]], device Counters& counters [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    if (i >= params.n)\n    {\n        return;\n    }\n    uint value = _34.values[i];\n    if ((value & 1u) == 1u)\n    {\n        uint _50 = atomic_fetch_add_explicit((device atomic_uint*)&counters.count, 1u, memory_order_relaxed);\n        uint slot = _50;\n        _54.kept[slot] = value;\n        int _63 = atomic_fetch_min_explicit((device atomic_int*)&counters.smallest, int(value), memory_order_relaxed);\n        int _68 = atomic_fetch_max_explicit((device atomic_int*)&counters.largest, int(value), memory_order_relaxed);\n        uint _72 = atomic_exchange_explicit((device atomic_uint*)&counters.last, value, memory_order_relaxed);\n    }\n    uint _77;\n    do\n    {\n        _77 = 0u;\n    } while (!atomic_compare_exchange_weak_explicit((device atomic_uint*)&counters.swapped, &_77, i + 1u, memory_order_relaxed, memory_order_relaxed) && _77 == 0u);\n}\n\n"
pub let compact_comp_group: u32[3] = [64, 1, 1]
pub let compact_comp_bindings: u8[16] = [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let compact_comp_fast_math: bool = false
pub let compact_comp_table: bool = false

# mark: arguments: compute kernel =============================================================

pub let arguments_comp_words: u32[256] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000020, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x0007000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000010, 0x00060010,
    0x00000004, 0x00000011, 0x00000001, 0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2,
    0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00050005, 0x00000009, 0x75677241, 0x746e656d,
    0x00000073, 0x00050006, 0x00000009, 0x00000000, 0x756f7267, 0x00007370, 0x00050005, 0x0000000b,
    0x75677261, 0x746e656d, 0x00000073, 0x00050005, 0x0000000e, 0x6e756f43, 0x73726574, 0x00000000,
    0x00050006, 0x0000000e, 0x00000000, 0x6e756f63, 0x00000074, 0x00050005, 0x00000010, 0x6e756f63,
    0x73726574, 0x00000000, 0x00040047, 0x00000008, 0x00000006, 0x00000004, 0x00030047, 0x00000009,
    0x00000002, 0x00040048, 0x00000009, 0x00000000, 0x00000019, 0x00050048, 0x00000009, 0x00000000,
    0x00000023, 0x00000000, 0x00030047, 0x0000000b, 0x00000019, 0x00040047, 0x0000000b, 0x00000021,
    0x00000001, 0x00040047, 0x0000000b, 0x00000022, 0x00000000, 0x00030047, 0x0000000e, 0x00000002,
    0x00040048, 0x0000000e, 0x00000000, 0x00000018, 0x00050048, 0x0000000e, 0x00000000, 0x00000023,
    0x00000000, 0x00030047, 0x00000010, 0x00000018, 0x00040047, 0x00000010, 0x00000021, 0x00000000,
    0x00040047, 0x00000010, 0x00000022, 0x00000000, 0x00040047, 0x0000001f, 0x0000000b, 0x00000019,
    0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020,
    0x00000000, 0x0004002b, 0x00000006, 0x00000007, 0x00000003, 0x0004001c, 0x00000008, 0x00000006,
    0x00000007, 0x0003001e, 0x00000009, 0x00000008, 0x00040020, 0x0000000a, 0x0000000c, 0x00000009,
    0x0004003b, 0x0000000a, 0x0000000b, 0x0000000c, 0x00040015, 0x0000000c, 0x00000020, 0x00000001,
    0x0004002b, 0x0000000c, 0x0000000d, 0x00000000, 0x0003001e, 0x0000000e, 0x00000006, 0x00040020,
    0x0000000f, 0x0000000c, 0x0000000e, 0x0004003b, 0x0000000f, 0x00000010, 0x0000000c, 0x00040020,
    0x00000011, 0x0000000c, 0x00000006, 0x0004002b, 0x00000006, 0x00000014, 0x0000003f, 0x0004002b,
    0x00000006, 0x00000016, 0x00000040, 0x0004002b, 0x0000000c, 0x00000019, 0x00000001, 0x0004002b,
    0x00000006, 0x0000001a, 0x00000001, 0x0004002b, 0x0000000c, 0x0000001c, 0x00000002, 0x00040017,
    0x0000001e, 0x00000006, 0x00000003, 0x0006002c, 0x0000001e, 0x0000001f, 0x0000001a, 0x0000001a,
    0x0000001a, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005,
    0x00050041, 0x00000011, 0x00000012, 0x00000010, 0x0000000d, 0x0004003d, 0x00000006, 0x00000013,
    0x00000012, 0x00050080, 0x00000006, 0x00000015, 0x00000013, 0x00000014, 0x00050086, 0x00000006,
    0x00000017, 0x00000015, 0x00000016, 0x00060041, 0x00000011, 0x00000018, 0x0000000b, 0x0000000d,
    0x0000000d, 0x0003003e, 0x00000018, 0x00000017, 0x00060041, 0x00000011, 0x0000001b, 0x0000000b,
    0x0000000d, 0x00000019, 0x0003003e, 0x0000001b, 0x0000001a, 0x00060041, 0x00000011, 0x0000001d,
    0x0000000b, 0x0000000d, 0x0000001c, 0x0003003e, 0x0000001d, 0x0000001a, 0x000100fd, 0x00010038,
]

pub let arguments_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct Arguments\n{\n    uint groups[3];\n};\n\nstruct Counters\n{\n    uint count;\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);\n\nkernel void luce_compute(device Counters& counters [[buffer(0)]], device Arguments& arguments [[buffer(1)]])\n{\n    arguments.groups[0] = (counters.count + 63u) / 64u;\n    arguments.groups[1] = 1u;\n    arguments.groups[2] = 1u;\n}\n\n"
pub let arguments_comp_group: u32[3] = [1, 1, 1]
pub let arguments_comp_bindings: u8[16] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let arguments_comp_fast_math: bool = false
pub let arguments_comp_table: bool = false

# mark: double: compute kernel ================================================================

pub let double_comp_words: u32[300] = [
    0x07230203, 0x00010500, 0x0008000b, 0x0000002a, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x0008000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000013, 0x00000020,
    0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001, 0x00030003, 0x00000002,
    0x000001c2, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005, 0x00000008, 0x00000069,
    0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044,
    0x00050005, 0x00000011, 0x6e756f43, 0x73726574, 0x00000000, 0x00050006, 0x00000011, 0x00000000,
    0x6e756f63, 0x00000074, 0x00050005, 0x00000013, 0x6e756f63, 0x73726574, 0x00000000, 0x00040005,
    0x0000001e, 0x6d657449, 0x00000073, 0x00050006, 0x0000001e, 0x00000000, 0x6d657469, 0x00000073,
    0x00030005, 0x00000020, 0x00000000, 0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00030047,
    0x00000011, 0x00000002, 0x00040048, 0x00000011, 0x00000000, 0x00000018, 0x00050048, 0x00000011,
    0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000013, 0x00000018, 0x00040047, 0x00000013,
    0x00000021, 0x00000001, 0x00040047, 0x00000013, 0x00000022, 0x00000000, 0x00040047, 0x0000001d,
    0x00000006, 0x00000004, 0x00030047, 0x0000001e, 0x00000002, 0x00050048, 0x0000001e, 0x00000000,
    0x00000023, 0x00000000, 0x00040047, 0x00000020, 0x00000021, 0x00000000, 0x00040047, 0x00000020,
    0x00000022, 0x00000000, 0x00040047, 0x00000029, 0x0000000b, 0x00000019, 0x00020013, 0x00000002,
    0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020,
    0x00000007, 0x00000007, 0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020,
    0x0000000a, 0x00000001, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b,
    0x00000006, 0x0000000c, 0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x0003001e,
    0x00000011, 0x00000006, 0x00040020, 0x00000012, 0x0000000c, 0x00000011, 0x0004003b, 0x00000012,
    0x00000013, 0x0000000c, 0x00040015, 0x00000014, 0x00000020, 0x00000001, 0x0004002b, 0x00000014,
    0x00000015, 0x00000000, 0x00040020, 0x00000016, 0x0000000c, 0x00000006, 0x00020014, 0x00000019,
    0x0003001d, 0x0000001d, 0x00000006, 0x0003001e, 0x0000001e, 0x0000001d, 0x00040020, 0x0000001f,
    0x0000000c, 0x0000001e, 0x0004003b, 0x0000001f, 0x00000020, 0x0000000c, 0x0004002b, 0x00000006,
    0x00000022, 0x00000002, 0x0004002b, 0x00000006, 0x00000027, 0x00000040, 0x0004002b, 0x00000006,
    0x00000028, 0x00000001, 0x0006002c, 0x00000009, 0x00000029, 0x00000027, 0x00000028, 0x00000028,
    0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b,
    0x00000007, 0x00000008, 0x00000007, 0x00050041, 0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c,
    0x0004003d, 0x00000006, 0x0000000f, 0x0000000e, 0x0003003e, 0x00000008, 0x0000000f, 0x0004003d,
    0x00000006, 0x00000010, 0x00000008, 0x00050041, 0x00000016, 0x00000017, 0x00000013, 0x00000015,
    0x0004003d, 0x00000006, 0x00000018, 0x00000017, 0x000500b0, 0x00000019, 0x0000001a, 0x00000010,
    0x00000018, 0x000300f7, 0x0000001c, 0x00000000, 0x000400fa, 0x0000001a, 0x0000001b, 0x0000001c,
    0x000200f8, 0x0000001b, 0x0004003d, 0x00000006, 0x00000021, 0x00000008, 0x00060041, 0x00000016,
    0x00000023, 0x00000020, 0x00000015, 0x00000021, 0x0004003d, 0x00000006, 0x00000024, 0x00000023,
    0x00050084, 0x00000006, 0x00000025, 0x00000024, 0x00000022, 0x00060041, 0x00000016, 0x00000026,
    0x00000020, 0x00000015, 0x00000021, 0x0003003e, 0x00000026, 0x00000025, 0x000200f9, 0x0000001c,
    0x000200f8, 0x0000001c, 0x000100fd, 0x00010038,
]

pub let double_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct Counters\n{\n    uint count;\n};\n\nstruct Items\n{\n    uint items[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(device Items& _32 [[buffer(0)]], device Counters& counters [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    if (i < counters.count)\n    {\n        _32.items[i] *= 2u;\n    }\n}\n\n"
pub let double_comp_group: u32[3] = [64, 1, 1]
pub let double_comp_bindings: u8[16] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let double_comp_fast_math: bool = false
pub let double_comp_table: bool = false

# mark: image_write: compute kernel ===========================================================

pub let image_write_comp_words: u32[687] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000072, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
    0x00000031, 0x0006000b, 0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,
    0x00000000, 0x00000001, 0x000b000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000c,
    0x00000016, 0x00000033, 0x0000004a, 0x00000056, 0x00000064, 0x00060010, 0x00000004, 0x00000011,
    0x00000008, 0x00000008, 0x00000001, 0x00030003, 0x00000002, 0x000001c2, 0x00040005, 0x00000004,
    0x6e69616d, 0x00000000, 0x00030005, 0x00000009, 0x00007461, 0x00080005, 0x0000000c, 0x475f6c67,
    0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044, 0x00040005, 0x00000014, 0x657a6953,
    0x00000000, 0x00050006, 0x00000014, 0x00000000, 0x74646977, 0x00000068, 0x00050006, 0x00000014,
    0x00000001, 0x67696568, 0x00007468, 0x00040005, 0x00000016, 0x657a6973, 0x00000000, 0x00040005,
    0x0000002d, 0x65786574, 0x0000006c, 0x00040005, 0x00000033, 0x6f6c6f63, 0x00000072, 0x00040005,
    0x0000004a, 0x74706564, 0x00000068, 0x00030005, 0x00000056, 0x00736469, 0x00040005, 0x00000064,
    0x69746f6d, 0x00006e6f, 0x00040047, 0x0000000c, 0x0000000b, 0x0000001c, 0x00030047, 0x00000014,
    0x00000002, 0x00050048, 0x00000014, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000014,
    0x00000001, 0x00000023, 0x00000004, 0x00030047, 0x00000033, 0x00000019, 0x00040047, 0x00000033,
    0x00000021, 0x00000000, 0x00040047, 0x00000033, 0x00000022, 0x00000000, 0x00030047, 0x0000004a,
    0x00000019, 0x00040047, 0x0000004a, 0x00000021, 0x00000001, 0x00040047, 0x0000004a, 0x00000022,
    0x00000000, 0x00030047, 0x00000056, 0x00000019, 0x00040047, 0x00000056, 0x00000021, 0x00000002,
    0x00040047, 0x00000056, 0x00000022, 0x00000000, 0x00030047, 0x00000064, 0x00000019, 0x00040047,
    0x00000064, 0x00000021, 0x00000003, 0x00040047, 0x00000064, 0x00000022, 0x00000000, 0x00040047,
    0x00000071, 0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002,
    0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040017, 0x00000007, 0x00000006, 0x00000002,
    0x00040020, 0x00000008, 0x00000007, 0x00000007, 0x00040017, 0x0000000a, 0x00000006, 0x00000003,
    0x00040020, 0x0000000b, 0x00000001, 0x0000000a, 0x0004003b, 0x0000000b, 0x0000000c, 0x00000001,
    0x00020014, 0x0000000f, 0x0004002b, 0x00000006, 0x00000010, 0x00000000, 0x00040020, 0x00000011,
    0x00000007, 0x00000006, 0x0004001e, 0x00000014, 0x00000006, 0x00000006, 0x00040020, 0x00000015,
    0x00000009, 0x00000014, 0x0004003b, 0x00000015, 0x00000016, 0x00000009, 0x00040015, 0x00000017,
    0x00000020, 0x00000001, 0x0004002b, 0x00000017, 0x00000018, 0x00000000, 0x00040020, 0x00000019,
    0x00000009, 0x00000006, 0x0004002b, 0x00000006, 0x00000020, 0x00000001, 0x0004002b, 0x00000017,
    0x00000023, 0x00000001, 0x00040017, 0x0000002b, 0x00000017, 0x00000002, 0x00040020, 0x0000002c,
    0x00000007, 0x0000002b, 0x00030016, 0x00000030, 0x00000020, 0x00090019, 0x00000031, 0x00000030,
    0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00040020, 0x00000032,
    0x00000000, 0x00000031, 0x0004003b, 0x00000032, 0x00000033, 0x00000000, 0x0004002b, 0x00000030,
    0x00000044, 0x3f000000, 0x0004002b, 0x00000030, 0x00000045, 0x3f800000, 0x00040017, 0x00000046,
    0x00000030, 0x00000004, 0x00090019, 0x00000048, 0x00000030, 0x00000001, 0x00000000, 0x00000000,
    0x00000000, 0x00000002, 0x00000003, 0x00040020, 0x00000049, 0x00000000, 0x00000048, 0x0004003b,
    0x00000049, 0x0000004a, 0x00000000, 0x00090019, 0x00000054, 0x00000006, 0x00000001, 0x00000000,
    0x00000000, 0x00000000, 0x00000002, 0x00000021, 0x00040020, 0x00000055, 0x00000000, 0x00000054,
    0x0004003b, 0x00000055, 0x00000056, 0x00000000, 0x0004002b, 0x00000006, 0x0000005b, 0x000003e8,
    0x00040017, 0x00000060, 0x00000006, 0x00000004, 0x00090019, 0x00000062, 0x00000030, 0x00000001,
    0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000006, 0x00040020, 0x00000063, 0x00000000,
    0x00000062, 0x0004003b, 0x00000063, 0x00000064, 0x00000000, 0x0004002b, 0x00000030, 0x0000006e,
    0x00000000, 0x0004002b, 0x00000006, 0x00000070, 0x00000008, 0x0006002c, 0x0000000a, 0x00000071,
    0x00000070, 0x00000070, 0x00000020, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003,
    0x000200f8, 0x00000005, 0x0004003b, 0x00000008, 0x00000009, 0x00000007, 0x0004003b, 0x0000002c,
    0x0000002d, 0x00000007, 0x0004003d, 0x0000000a, 0x0000000d, 0x0000000c, 0x0007004f, 0x00000007,
    0x0000000e, 0x0000000d, 0x0000000d, 0x00000000, 0x00000001, 0x0003003e, 0x00000009, 0x0000000e,
    0x00050041, 0x00000011, 0x00000012, 0x00000009, 0x00000010, 0x0004003d, 0x00000006, 0x00000013,
    0x00000012, 0x00050041, 0x00000019, 0x0000001a, 0x00000016, 0x00000018, 0x0004003d, 0x00000006,
    0x0000001b, 0x0000001a, 0x000500ae, 0x0000000f, 0x0000001c, 0x00000013, 0x0000001b, 0x000400a8,
    0x0000000f, 0x0000001d, 0x0000001c, 0x000300f7, 0x0000001f, 0x00000000, 0x000400fa, 0x0000001d,
    0x0000001e, 0x0000001f, 0x000200f8, 0x0000001e, 0x00050041, 0x00000011, 0x00000021, 0x00000009,
    0x00000020, 0x0004003d, 0x00000006, 0x00000022, 0x00000021, 0x00050041, 0x00000019, 0x00000024,
    0x00000016, 0x00000023, 0x0004003d, 0x00000006, 0x00000025, 0x00000024, 0x000500ae, 0x0000000f,
    0x00000026, 0x00000022, 0x00000025, 0x000200f9, 0x0000001f, 0x000200f8, 0x0000001f, 0x000700f5,
    0x0000000f, 0x00000027, 0x0000001c, 0x00000005, 0x00000026, 0x0000001e, 0x000300f7, 0x00000029,
    0x00000000, 0x000400fa, 0x00000027, 0x00000028, 0x00000029, 0x000200f8, 0x00000028, 0x000100fd,
    0x000200f8, 0x00000029, 0x0004003d, 0x00000007, 0x0000002e, 0x00000009, 0x0004007c, 0x0000002b,
    0x0000002f, 0x0000002e, 0x0003003e, 0x0000002d, 0x0000002f, 0x0004003d, 0x00000031, 0x00000034,
    0x00000033, 0x0004003d, 0x0000002b, 0x00000035, 0x0000002d, 0x00050041, 0x00000011, 0x00000036,
    0x00000009, 0x00000010, 0x0004003d, 0x00000006, 0x00000037, 0x00000036, 0x00040070, 0x00000030,
    0x00000038, 0x00000037, 0x00050041, 0x00000019, 0x00000039, 0x00000016, 0x00000018, 0x0004003d,
    0x00000006, 0x0000003a, 0x00000039, 0x00040070, 0x00000030, 0x0000003b, 0x0000003a, 0x00050088,
    0x00000030, 0x0000003c, 0x00000038, 0x0000003b, 0x00050041, 0x00000011, 0x0000003d, 0x00000009,
    0x00000020, 0x0004003d, 0x00000006, 0x0000003e, 0x0000003d, 0x00040070, 0x00000030, 0x0000003f,
    0x0000003e, 0x00050041, 0x00000019, 0x00000040, 0x00000016, 0x00000023, 0x0004003d, 0x00000006,
    0x00000041, 0x00000040, 0x00040070, 0x00000030, 0x00000042, 0x00000041, 0x00050088, 0x00000030,
    0x00000043, 0x0000003f, 0x00000042, 0x00070050, 0x00000046, 0x00000047, 0x0000003c, 0x00000043,
    0x00000044, 0x00000045, 0x00040063, 0x00000034, 0x00000035, 0x00000047, 0x0004003d, 0x00000048,
    0x0000004b, 0x0000004a, 0x0004003d, 0x0000002b, 0x0000004c, 0x0000002d, 0x00050041, 0x00000011,
    0x0000004d, 0x00000009, 0x00000010, 0x0004003d, 0x00000006, 0x0000004e, 0x0000004d, 0x00050041,
    0x00000011, 0x0000004f, 0x00000009, 0x00000020, 0x0004003d, 0x00000006, 0x00000050, 0x0000004f,
    0x00050080, 0x00000006, 0x00000051, 0x0000004e, 0x00000050, 0x00040070, 0x00000030, 0x00000052,
    0x00000051, 0x00070050, 0x00000046, 0x00000053, 0x00000052, 0x00000052, 0x00000052, 0x00000052,
    0x00040063, 0x0000004b, 0x0000004c, 0x00000053, 0x0004003d, 0x00000054, 0x00000057, 0x00000056,
    0x0004003d, 0x0000002b, 0x00000058, 0x0000002d, 0x00050041, 0x00000011, 0x00000059, 0x00000009,
    0x00000010, 0x0004003d, 0x00000006, 0x0000005a, 0x00000059, 0x00050084, 0x00000006, 0x0000005c,
    0x0000005a, 0x0000005b, 0x00050041, 0x00000011, 0x0000005d, 0x00000009, 0x00000020, 0x0004003d,
    0x00000006, 0x0000005e, 0x0000005d, 0x00050080, 0x00000006, 0x0000005f, 0x0000005c, 0x0000005e,
    0x00070050, 0x00000060, 0x00000061, 0x0000005f, 0x0000005f, 0x0000005f, 0x0000005f, 0x00050063,
    0x00000057, 0x00000058, 0x00000061, 0x00002000, 0x0004003d, 0x00000062, 0x00000065, 0x00000064,
    0x0004003d, 0x0000002b, 0x00000066, 0x0000002d, 0x00050041, 0x00000011, 0x00000067, 0x00000009,
    0x00000010, 0x0004003d, 0x00000006, 0x00000068, 0x00000067, 0x00040070, 0x00000030, 0x00000069,
    0x00000068, 0x00050041, 0x00000011, 0x0000006a, 0x00000009, 0x00000020, 0x0004003d, 0x00000006,
    0x0000006b, 0x0000006a, 0x00040070, 0x00000030, 0x0000006c, 0x0000006b, 0x0004007f, 0x00000030,
    0x0000006d, 0x0000006c, 0x00070050, 0x00000046, 0x0000006f, 0x00000069, 0x0000006d, 0x0000006e,
    0x0000006e, 0x00040063, 0x00000065, 0x00000066, 0x0000006f, 0x000100fd, 0x00010038,
]

pub let image_write_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct Size\n{\n    uint width;\n    uint height;\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(8u, 8u, 1u);\n\nkernel void luce_compute(constant Size& size [[buffer(30)]], texture2d<float, access::write> color [[texture(0)]], texture2d<float, access::write> depth [[texture(1)]], texture2d<uint, access::write> ids [[texture(2)]], texture2d<float, access::write> motion [[texture(3)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint2 at = gl_GlobalInvocationID.xy;\n    bool _28 = at.x >= size.width;\n    bool _39;\n    if (!_28)\n    {\n        _39 = at.y >= size.height;\n    }\n    else\n    {\n        _39 = _28;\n    }\n    if (_39)\n    {\n        return;\n    }\n    int2 texel = int2(at);\n    color.write(float4(float(at.x) / float(size.width), float(at.y) / float(size.height), 0.5, 1.0), uint2(texel));\n    depth.write(float4(float(at.x + at.y)), uint2(texel));\n    ids.write(uint4((at.x * 1000u) + at.y), uint2(texel));\n    motion.write(float4(float(at.x), -float(at.y), 0.0, 0.0), uint2(texel));\n}\n\n"
pub let image_write_comp_group: u32[3] = [8, 8, 1]
pub let image_write_comp_bindings: u8[16] = [2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let image_write_comp_fast_math: bool = false
pub let image_write_comp_table: bool = false

# mark: image_accumulate: compute kernel ======================================================

pub let image_accumulate_comp_words: u32[580] = [
    0x07230203, 0x00010500, 0x0008000b, 0x0000005b, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x000b000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000c, 0x00000016, 0x00000033,
    0x0000003d, 0x00000046, 0x00000051, 0x00060010, 0x00000004, 0x00000011, 0x00000008, 0x00000008,
    0x00000001, 0x00030003, 0x00000002, 0x000001c2, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000,
    0x00030005, 0x00000009, 0x00007461, 0x00080005, 0x0000000c, 0x475f6c67, 0x61626f6c, 0x766e496c,
    0x7461636f, 0x496e6f69, 0x00000044, 0x00040005, 0x00000014, 0x657a6953, 0x00000000, 0x00050006,
    0x00000014, 0x00000000, 0x74646977, 0x00000068, 0x00050006, 0x00000014, 0x00000001, 0x67696568,
    0x00007468, 0x00040005, 0x00000016, 0x657a6973, 0x00000000, 0x00040005, 0x0000002d, 0x65786574,
    0x0000006c, 0x00040005, 0x00000033, 0x61746f74, 0x0000006c, 0x00040005, 0x0000003d, 0x72756f73,
    0x00006563, 0x00030005, 0x00000044, 0x0074754f, 0x00050006, 0x00000044, 0x00000000, 0x756c6176,
    0x00007365, 0x00030005, 0x00000046, 0x00000000, 0x00030005, 0x00000051, 0x00736469, 0x00040047,
    0x0000000c, 0x0000000b, 0x0000001c, 0x00030047, 0x00000014, 0x00000002, 0x00050048, 0x00000014,
    0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000014, 0x00000001, 0x00000023, 0x00000004,
    0x00040047, 0x00000033, 0x00000021, 0x00000001, 0x00040047, 0x00000033, 0x00000022, 0x00000000,
    0x00040047, 0x0000003d, 0x00000021, 0x00000000, 0x00040047, 0x0000003d, 0x00000022, 0x00000000,
    0x00040047, 0x00000043, 0x00000006, 0x00000004, 0x00030047, 0x00000044, 0x00000002, 0x00040048,
    0x00000044, 0x00000000, 0x00000019, 0x00050048, 0x00000044, 0x00000000, 0x00000023, 0x00000000,
    0x00030047, 0x00000046, 0x00000019, 0x00040047, 0x00000046, 0x00000021, 0x00000003, 0x00040047,
    0x00000046, 0x00000022, 0x00000000, 0x00030047, 0x00000051, 0x00000018, 0x00040047, 0x00000051,
    0x00000021, 0x00000002, 0x00040047, 0x00000051, 0x00000022, 0x00000000, 0x00040047, 0x0000005a,
    0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00040015,
    0x00000006, 0x00000020, 0x00000000, 0x00040017, 0x00000007, 0x00000006, 0x00000002, 0x00040020,
    0x00000008, 0x00000007, 0x00000007, 0x00040017, 0x0000000a, 0x00000006, 0x00000003, 0x00040020,
    0x0000000b, 0x00000001, 0x0000000a, 0x0004003b, 0x0000000b, 0x0000000c, 0x00000001, 0x00020014,
    0x0000000f, 0x0004002b, 0x00000006, 0x00000010, 0x00000000, 0x00040020, 0x00000011, 0x00000007,
    0x00000006, 0x0004001e, 0x00000014, 0x00000006, 0x00000006, 0x00040020, 0x00000015, 0x00000009,
    0x00000014, 0x0004003b, 0x00000015, 0x00000016, 0x00000009, 0x00040015, 0x00000017, 0x00000020,
    0x00000001, 0x0004002b, 0x00000017, 0x00000018, 0x00000000, 0x00040020, 0x00000019, 0x00000009,
    0x00000006, 0x0004002b, 0x00000006, 0x00000020, 0x00000001, 0x0004002b, 0x00000017, 0x00000023,
    0x00000001, 0x00040017, 0x0000002b, 0x00000017, 0x00000002, 0x00040020, 0x0000002c, 0x00000007,
    0x0000002b, 0x00030016, 0x00000030, 0x00000020, 0x00090019, 0x00000031, 0x00000030, 0x00000001,
    0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00040020, 0x00000032, 0x00000000,
    0x00000031, 0x0004003b, 0x00000032, 0x00000033, 0x00000000, 0x00040017, 0x00000038, 0x00000030,
    0x00000004, 0x00090019, 0x0000003a, 0x00000030, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
    0x00000001, 0x00000000, 0x0003001b, 0x0000003b, 0x0000003a, 0x00040020, 0x0000003c, 0x00000000,
    0x0000003b, 0x0004003b, 0x0000003c, 0x0000003d, 0x00000000, 0x0003001d, 0x00000043, 0x00000006,
    0x0003001e, 0x00000044, 0x00000043, 0x00040020, 0x00000045, 0x0000000c, 0x00000044, 0x0004003b,
    0x00000045, 0x00000046, 0x0000000c, 0x00090019, 0x0000004f, 0x00000006, 0x00000001, 0x00000000,
    0x00000000, 0x00000000, 0x00000002, 0x00000021, 0x00040020, 0x00000050, 0x00000000, 0x0000004f,
    0x0004003b, 0x00000050, 0x00000051, 0x00000000, 0x00040017, 0x00000054, 0x00000006, 0x00000004,
    0x00040020, 0x00000057, 0x0000000c, 0x00000006, 0x0004002b, 0x00000006, 0x00000059, 0x00000008,
    0x0006002c, 0x0000000a, 0x0000005a, 0x00000059, 0x00000059, 0x00000020, 0x00050036, 0x00000002,
    0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x00000008, 0x00000009,
    0x00000007, 0x0004003b, 0x0000002c, 0x0000002d, 0x00000007, 0x0004003d, 0x0000000a, 0x0000000d,
    0x0000000c, 0x0007004f, 0x00000007, 0x0000000e, 0x0000000d, 0x0000000d, 0x00000000, 0x00000001,
    0x0003003e, 0x00000009, 0x0000000e, 0x00050041, 0x00000011, 0x00000012, 0x00000009, 0x00000010,
    0x0004003d, 0x00000006, 0x00000013, 0x00000012, 0x00050041, 0x00000019, 0x0000001a, 0x00000016,
    0x00000018, 0x0004003d, 0x00000006, 0x0000001b, 0x0000001a, 0x000500ae, 0x0000000f, 0x0000001c,
    0x00000013, 0x0000001b, 0x000400a8, 0x0000000f, 0x0000001d, 0x0000001c, 0x000300f7, 0x0000001f,
    0x00000000, 0x000400fa, 0x0000001d, 0x0000001e, 0x0000001f, 0x000200f8, 0x0000001e, 0x00050041,
    0x00000011, 0x00000021, 0x00000009, 0x00000020, 0x0004003d, 0x00000006, 0x00000022, 0x00000021,
    0x00050041, 0x00000019, 0x00000024, 0x00000016, 0x00000023, 0x0004003d, 0x00000006, 0x00000025,
    0x00000024, 0x000500ae, 0x0000000f, 0x00000026, 0x00000022, 0x00000025, 0x000200f9, 0x0000001f,
    0x000200f8, 0x0000001f, 0x000700f5, 0x0000000f, 0x00000027, 0x0000001c, 0x00000005, 0x00000026,
    0x0000001e, 0x000300f7, 0x00000029, 0x00000000, 0x000400fa, 0x00000027, 0x00000028, 0x00000029,
    0x000200f8, 0x00000028, 0x000100fd, 0x000200f8, 0x00000029, 0x0004003d, 0x00000007, 0x0000002e,
    0x00000009, 0x0004007c, 0x0000002b, 0x0000002f, 0x0000002e, 0x0003003e, 0x0000002d, 0x0000002f,
    0x0004003d, 0x00000031, 0x00000034, 0x00000033, 0x0004003d, 0x0000002b, 0x00000035, 0x0000002d,
    0x0004003d, 0x00000031, 0x00000036, 0x00000033, 0x0004003d, 0x0000002b, 0x00000037, 0x0000002d,
    0x00050062, 0x00000038, 0x00000039, 0x00000036, 0x00000037, 0x0004003d, 0x0000003b, 0x0000003e,
    0x0000003d, 0x0004003d, 0x0000002b, 0x0000003f, 0x0000002d, 0x00040064, 0x0000003a, 0x00000040,
    0x0000003e, 0x0007005f, 0x00000038, 0x00000041, 0x00000040, 0x0000003f, 0x00000002, 0x00000018,
    0x00050081, 0x00000038, 0x00000042, 0x00000039, 0x00000041, 0x00040063, 0x00000034, 0x00000035,
    0x00000042, 0x00050041, 0x00000011, 0x00000047, 0x00000009, 0x00000020, 0x0004003d, 0x00000006,
    0x00000048, 0x00000047, 0x00050041, 0x00000019, 0x00000049, 0x00000016, 0x00000018, 0x0004003d,
    0x00000006, 0x0000004a, 0x00000049, 0x00050084, 0x00000006, 0x0000004b, 0x00000048, 0x0000004a,
    0x00050041, 0x00000011, 0x0000004c, 0x00000009, 0x00000010, 0x0004003d, 0x00000006, 0x0000004d,
    0x0000004c, 0x00050080, 0x00000006, 0x0000004e, 0x0000004b, 0x0000004d, 0x0004003d, 0x0000004f,
    0x00000052, 0x00000051, 0x0004003d, 0x0000002b, 0x00000053, 0x0000002d, 0x00060062, 0x00000054,
    0x00000055, 0x00000052, 0x00000053, 0x00002000, 0x00050051, 0x00000006, 0x00000056, 0x00000055,
    0x00000000, 0x00060041, 0x00000057, 0x00000058, 0x00000046, 0x00000018, 0x0000004e, 0x0003003e,
    0x00000058, 0x00000056, 0x000100fd, 0x00010038,
]

pub let image_accumulate_comp_msl: c.str = "#pragma clang diagnostic ignored \"-Wmissing-prototypes\"\n\n#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\ntemplate <typename ImageT>\nvoid spvImageFence(ImageT img) { img.fence(); }\n\nstruct Size\n{\n    uint width;\n    uint height;\n};\n\nstruct Out\n{\n    uint values[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(8u, 8u, 1u);\n\nkernel void luce_compute(constant Size& size [[buffer(30)]], device Out& _70 [[buffer(3)]], texture2d<float> source [[texture(0)]], texture2d<float, access::read_write> total [[texture(1)]], texture2d<uint> ids [[texture(2)]], sampler sourceSmplr [[sampler(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint2 at = gl_GlobalInvocationID.xy;\n    bool _28 = at.x >= size.width;\n    bool _39;\n    if (!_28)\n    {\n        _39 = at.y >= size.height;\n    }\n    else\n    {\n        _39 = _28;\n    }\n    if (_39)\n    {\n        return;\n    }\n    int2 texel = int2(at);\n    spvImageFence(total);\n    total.write(total.read(uint2(texel)) + source.read(uint2(texel), 0), uint2(texel));\n    _70.values[(at.y * size.width) + at.x] = ids.read(uint2(texel)).x;\n}\n\n"
pub let image_accumulate_comp_group: u32[3] = [8, 8, 1]
pub let image_accumulate_comp_bindings: u8[16] = [3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let image_accumulate_comp_fast_math: bool = false
pub let image_accumulate_comp_table: bool = false

# mark: float_sum: compute kernel =============================================================

pub let float_sum_comp_words: u32[349] = [
    0x07230203, 0x00010500, 0x0008000b, 0x0000002e, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
    0x00001791, 0x0009000a, 0x5f565053, 0x5f545845, 0x64616873, 0x615f7265, 0x696d6f74, 0x6c665f63,
    0x5f74616f, 0x00646461, 0x0006000b, 0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000,
    0x0003000e, 0x00000000, 0x00000001, 0x0009000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000,
    0x0000000b, 0x00000013, 0x00000020, 0x00000026, 0x00060010, 0x00000004, 0x00000011, 0x00000040,
    0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2, 0x00080004, 0x455f4c47, 0x735f5458,
    0x65646168, 0x74615f72, 0x63696d6f, 0x6f6c665f, 0x00007461, 0x00040005, 0x00000004, 0x6e69616d,
    0x00000000, 0x00030005, 0x00000008, 0x00000069, 0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c,
    0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044, 0x00040005, 0x00000011, 0x61726150, 0x0000736d,
    0x00040006, 0x00000011, 0x00000000, 0x0000006e, 0x00040005, 0x00000013, 0x61726170, 0x0000736d,
    0x00040005, 0x0000001e, 0x61746f54, 0x0000006c, 0x00050006, 0x0000001e, 0x00000000, 0x61746f74,
    0x0000006c, 0x00030005, 0x00000020, 0x00000000, 0x00040005, 0x00000024, 0x756c6156, 0x00007365,
    0x00050006, 0x00000024, 0x00000000, 0x756c6176, 0x00007365, 0x00030005, 0x00000026, 0x00000000,
    0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00030047, 0x00000011, 0x00000002, 0x00050048,
    0x00000011, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x0000001e, 0x00000002, 0x00050048,
    0x0000001e, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000020, 0x00000021, 0x00000001,
    0x00040047, 0x00000020, 0x00000022, 0x00000000, 0x00040047, 0x00000023, 0x00000006, 0x00000004,
    0x00030047, 0x00000024, 0x00000002, 0x00040048, 0x00000024, 0x00000000, 0x00000018, 0x00050048,
    0x00000024, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000026, 0x00000018, 0x00040047,
    0x00000026, 0x00000021, 0x00000000, 0x00040047, 0x00000026, 0x00000022, 0x00000000, 0x00040047,
    0x0000002d, 0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002,
    0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020, 0x00000007, 0x00000007, 0x00000006,
    0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020, 0x0000000a, 0x00000001, 0x00000009,
    0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b, 0x00000006, 0x0000000c, 0x00000000,
    0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x0003001e, 0x00000011, 0x00000006, 0x00040020,
    0x00000012, 0x00000009, 0x00000011, 0x0004003b, 0x00000012, 0x00000013, 0x00000009, 0x00040015,
    0x00000014, 0x00000020, 0x00000001, 0x0004002b, 0x00000014, 0x00000015, 0x00000000, 0x00040020,
    0x00000016, 0x00000009, 0x00000006, 0x00020014, 0x00000019, 0x00030016, 0x0000001d, 0x00000020,
    0x0003001e, 0x0000001e, 0x0000001d, 0x00040020, 0x0000001f, 0x0000000c, 0x0000001e, 0x0004003b,
    0x0000001f, 0x00000020, 0x0000000c, 0x00040020, 0x00000021, 0x0000000c, 0x0000001d, 0x0003001d,
    0x00000023, 0x0000001d, 0x0003001e, 0x00000024, 0x00000023, 0x00040020, 0x00000025, 0x0000000c,
    0x00000024, 0x0004003b, 0x00000025, 0x00000026, 0x0000000c, 0x0004002b, 0x00000006, 0x0000002a,
    0x00000001, 0x0004002b, 0x00000006, 0x0000002c, 0x00000040, 0x0006002c, 0x00000009, 0x0000002d,
    0x0000002c, 0x0000002a, 0x0000002a, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003,
    0x000200f8, 0x00000005, 0x0004003b, 0x00000007, 0x00000008, 0x00000007, 0x00050041, 0x0000000d,
    0x0000000e, 0x0000000b, 0x0000000c, 0x0004003d, 0x00000006, 0x0000000f, 0x0000000e, 0x0003003e,
    0x00000008, 0x0000000f, 0x0004003d, 0x00000006, 0x00000010, 0x00000008, 0x00050041, 0x00000016,
    0x00000017, 0x00000013, 0x00000015, 0x0004003d, 0x00000006, 0x00000018, 0x00000017, 0x000500b0,
    0x00000019, 0x0000001a, 0x00000010, 0x00000018, 0x000300f7, 0x0000001c, 0x00000000, 0x000400fa,
    0x0000001a, 0x0000001b, 0x0000001c, 0x000200f8, 0x0000001b, 0x00050041, 0x00000021, 0x00000022,
    0x00000020, 0x00000015, 0x0004003d, 0x00000006, 0x00000027, 0x00000008, 0x00060041, 0x00000021,
    0x00000028, 0x00000026, 0x00000015, 0x00000027, 0x0004003d, 0x0000001d, 0x00000029, 0x00000028,
    0x00071793, 0x0000001d, 0x0000002b, 0x00000022, 0x0000002a, 0x0000000c, 0x00000029, 0x000200f9,
    0x0000001c, 0x000200f8, 0x0000001c, 0x000100fd, 0x00010038,
]

pub let float_sum_comp_msl: c.str = "#pragma clang diagnostic ignored \"-Wunused-variable\"\n\n#include <metal_stdlib>\n#include <simd/simd.h>\n#include <metal_atomic>\n\nusing namespace metal;\n\nstruct Params\n{\n    uint n;\n};\n\nstruct Total\n{\n    float total;\n};\n\nstruct Values\n{\n    float values[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(constant Params& params [[buffer(30)]], device Values& _38 [[buffer(0)]], device Total& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    if (i < params.n)\n    {\n        float _43 = atomic_fetch_add_explicit((device atomic_float*)&_32.total, _38.values[i], memory_order_relaxed);\n    }\n}\n\n"
pub let float_sum_comp_group: u32[3] = [64, 1, 1]
pub let float_sum_comp_bindings: u8[16] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let float_sum_comp_fast_math: bool = false
pub let float_sum_comp_table: bool = false

# mark: ieee: compute kernel ==================================================================

pub let ieee_comp_words: u32[687] = [
    0x07230203, 0x00010500, 0x0008000b, 0x0000006c, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x0007000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000041, 0x00060010,
    0x00000004, 0x00000011, 0x00000001, 0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2,
    0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00050005, 0x00000008, 0x69736f70, 0x65766974,
    0x00000000, 0x00030005, 0x00000009, 0x00006e49, 0x00050006, 0x00000009, 0x00000000, 0x6f72657a,
    0x00000000, 0x00040006, 0x00000009, 0x00000001, 0x00656e6f, 0x00040006, 0x00000009, 0x00000002,
    0x00776f6c, 0x00050006, 0x00000009, 0x00000003, 0x68676968, 0x00000000, 0x00030005, 0x0000000b,
    0x00000076, 0x00050005, 0x00000015, 0x6167656e, 0x65766974, 0x00000000, 0x00030005, 0x0000001c,
    0x006e616e, 0x00040005, 0x00000022, 0x7261656e, 0x00000000, 0x00030005, 0x00000030, 0x00726166,
    0x00030005, 0x0000003f, 0x0074754f, 0x00050006, 0x0000003f, 0x00000000, 0x75736572, 0x0073746c,
    0x00030005, 0x00000041, 0x0000006f, 0x00030047, 0x00000009, 0x00000002, 0x00040048, 0x00000009,
    0x00000000, 0x00000018, 0x00050048, 0x00000009, 0x00000000, 0x00000023, 0x00000000, 0x00040048,
    0x00000009, 0x00000001, 0x00000018, 0x00050048, 0x00000009, 0x00000001, 0x00000023, 0x00000004,
    0x00040048, 0x00000009, 0x00000002, 0x00000018, 0x00050048, 0x00000009, 0x00000002, 0x00000023,
    0x00000008, 0x00040048, 0x00000009, 0x00000003, 0x00000018, 0x00050048, 0x00000009, 0x00000003,
    0x00000023, 0x0000000c, 0x00030047, 0x0000000b, 0x00000018, 0x00040047, 0x0000000b, 0x00000021,
    0x00000000, 0x00040047, 0x0000000b, 0x00000022, 0x00000000, 0x00040047, 0x0000003e, 0x00000006,
    0x00000004, 0x00030047, 0x0000003f, 0x00000002, 0x00040048, 0x0000003f, 0x00000000, 0x00000019,
    0x00050048, 0x0000003f, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000041, 0x00000019,
    0x00040047, 0x00000041, 0x00000021, 0x00000001, 0x00040047, 0x00000041, 0x00000022, 0x00000000,
    0x00040047, 0x0000006b, 0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003,
    0x00000002, 0x00030016, 0x00000006, 0x00000020, 0x00040020, 0x00000007, 0x00000007, 0x00000006,
    0x0006001e, 0x00000009, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00040020, 0x0000000a,
    0x0000000c, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x0000000c, 0x00040015, 0x0000000c,
    0x00000020, 0x00000001, 0x0004002b, 0x0000000c, 0x0000000d, 0x00000001, 0x00040020, 0x0000000e,
    0x0000000c, 0x00000006, 0x0004002b, 0x0000000c, 0x00000011, 0x00000000, 0x0004002b, 0x0000000c,
    0x00000023, 0x00000002, 0x0004002b, 0x0000000c, 0x00000029, 0x00000003, 0x00040015, 0x0000003c,
    0x00000020, 0x00000000, 0x0004002b, 0x0000003c, 0x0000003d, 0x00000008, 0x0004001c, 0x0000003e,
    0x0000003c, 0x0000003d, 0x0003001e, 0x0000003f, 0x0000003e, 0x00040020, 0x00000040, 0x0000000c,
    0x0000003f, 0x0004003b, 0x00000040, 0x00000041, 0x0000000c, 0x00040020, 0x00000044, 0x0000000c,
    0x0000003c, 0x00020014, 0x0000004a, 0x0004002b, 0x0000003c, 0x0000004c, 0x00000001, 0x0004002b,
    0x0000003c, 0x0000004d, 0x00000000, 0x0004002b, 0x0000000c, 0x00000054, 0x00000004, 0x0004002b,
    0x0000000c, 0x0000005a, 0x00000005, 0x0004002b, 0x0000000c, 0x0000005e, 0x00000006, 0x0004002b,
    0x0000000c, 0x00000062, 0x00000007, 0x00040017, 0x0000006a, 0x0000003c, 0x00000003, 0x0006002c,
    0x0000006a, 0x0000006b, 0x0000004c, 0x0000004c, 0x0000004c, 0x00050036, 0x00000002, 0x00000004,
    0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x00000007, 0x00000008, 0x00000007,
    0x0004003b, 0x00000007, 0x00000015, 0x00000007, 0x0004003b, 0x00000007, 0x0000001c, 0x00000007,
    0x0004003b, 0x00000007, 0x00000022, 0x00000007, 0x0004003b, 0x00000007, 0x00000030, 0x00000007,
    0x00050041, 0x0000000e, 0x0000000f, 0x0000000b, 0x0000000d, 0x0004003d, 0x00000006, 0x00000010,
    0x0000000f, 0x00050041, 0x0000000e, 0x00000012, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006,
    0x00000013, 0x00000012, 0x00050088, 0x00000006, 0x00000014, 0x00000010, 0x00000013, 0x0003003e,
    0x00000008, 0x00000014, 0x00050041, 0x0000000e, 0x00000016, 0x0000000b, 0x0000000d, 0x0004003d,
    0x00000006, 0x00000017, 0x00000016, 0x0004007f, 0x00000006, 0x00000018, 0x00000017, 0x00050041,
    0x0000000e, 0x00000019, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006, 0x0000001a, 0x00000019,
    0x00050088, 0x00000006, 0x0000001b, 0x00000018, 0x0000001a, 0x0003003e, 0x00000015, 0x0000001b,
    0x00050041, 0x0000000e, 0x0000001d, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006, 0x0000001e,
    0x0000001d, 0x00050041, 0x0000000e, 0x0000001f, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006,
    0x00000020, 0x0000001f, 0x00050088, 0x00000006, 0x00000021, 0x0000001e, 0x00000020, 0x0003003e,
    0x0000001c, 0x00000021, 0x00050041, 0x0000000e, 0x00000024, 0x0000000b, 0x00000023, 0x0004003d,
    0x00000006, 0x00000025, 0x00000024, 0x00050041, 0x0000000e, 0x00000026, 0x0000000b, 0x00000011,
    0x0004003d, 0x00000006, 0x00000027, 0x00000026, 0x00050088, 0x00000006, 0x00000028, 0x00000025,
    0x00000027, 0x00050041, 0x0000000e, 0x0000002a, 0x0000000b, 0x00000029, 0x0004003d, 0x00000006,
    0x0000002b, 0x0000002a, 0x00050041, 0x0000000e, 0x0000002c, 0x0000000b, 0x00000011, 0x0004003d,
    0x00000006, 0x0000002d, 0x0000002c, 0x00050088, 0x00000006, 0x0000002e, 0x0000002b, 0x0000002d,
    0x0007000c, 0x00000006, 0x0000002f, 0x00000001, 0x00000025, 0x00000028, 0x0000002e, 0x0003003e,
    0x00000022, 0x0000002f, 0x00050041, 0x0000000e, 0x00000031, 0x0000000b, 0x00000023, 0x0004003d,
    0x00000006, 0x00000032, 0x00000031, 0x00050041, 0x0000000e, 0x00000033, 0x0000000b, 0x00000011,
    0x0004003d, 0x00000006, 0x00000034, 0x00000033, 0x00050088, 0x00000006, 0x00000035, 0x00000032,
    0x00000034, 0x00050041, 0x0000000e, 0x00000036, 0x0000000b, 0x00000029, 0x0004003d, 0x00000006,
    0x00000037, 0x00000036, 0x00050041, 0x0000000e, 0x00000038, 0x0000000b, 0x00000011, 0x0004003d,
    0x00000006, 0x00000039, 0x00000038, 0x00050088, 0x00000006, 0x0000003a, 0x00000037, 0x00000039,
    0x0007000c, 0x00000006, 0x0000003b, 0x00000001, 0x00000028, 0x00000035, 0x0000003a, 0x0003003e,
    0x00000030, 0x0000003b, 0x0004003d, 0x00000006, 0x00000042, 0x00000008, 0x0004007c, 0x0000003c,
    0x00000043, 0x00000042, 0x00060041, 0x00000044, 0x00000045, 0x00000041, 0x00000011, 0x00000011,
    0x0003003e, 0x00000045, 0x00000043, 0x0004003d, 0x00000006, 0x00000046, 0x00000015, 0x0004007c,
    0x0000003c, 0x00000047, 0x00000046, 0x00060041, 0x00000044, 0x00000048, 0x00000041, 0x00000011,
    0x0000000d, 0x0003003e, 0x00000048, 0x00000047, 0x0004003d, 0x00000006, 0x00000049, 0x0000001c,
    0x0004009c, 0x0000004a, 0x0000004b, 0x00000049, 0x000600a9, 0x0000003c, 0x0000004e, 0x0000004b,
    0x0000004c, 0x0000004d, 0x00060041, 0x00000044, 0x0000004f, 0x00000041, 0x00000011, 0x00000023,
    0x0003003e, 0x0000004f, 0x0000004e, 0x0004003d, 0x00000006, 0x00000050, 0x00000008, 0x0004009d,
    0x0000004a, 0x00000051, 0x00000050, 0x000600a9, 0x0000003c, 0x00000052, 0x00000051, 0x0000004c,
    0x0000004d, 0x00060041, 0x00000044, 0x00000053, 0x00000041, 0x00000011, 0x00000029, 0x0003003e,
    0x00000053, 0x00000052, 0x0004003d, 0x00000006, 0x00000055, 0x0000001c, 0x0004003d, 0x00000006,
    0x00000056, 0x0000001c, 0x000500b7, 0x0000004a, 0x00000057, 0x00000055, 0x00000056, 0x000600a9,
    0x0000003c, 0x00000058, 0x00000057, 0x0000004c, 0x0000004d, 0x00060041, 0x00000044, 0x00000059,
    0x00000041, 0x00000011, 0x00000054, 0x0003003e, 0x00000059, 0x00000058, 0x0004003d, 0x00000006,
    0x0000005b, 0x00000022, 0x0004007c, 0x0000003c, 0x0000005c, 0x0000005b, 0x00060041, 0x00000044,
    0x0000005d, 0x00000041, 0x00000011, 0x0000005a, 0x0003003e, 0x0000005d, 0x0000005c, 0x0004003d,
    0x00000006, 0x0000005f, 0x00000030, 0x0004007c, 0x0000003c, 0x00000060, 0x0000005f, 0x00060041,
    0x00000044, 0x00000061, 0x00000041, 0x00000011, 0x0000005e, 0x0003003e, 0x00000061, 0x00000060,
    0x00050041, 0x0000000e, 0x00000063, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006, 0x00000064,
    0x00000063, 0x0004003d, 0x00000006, 0x00000065, 0x00000008, 0x00050085, 0x00000006, 0x00000066,
    0x00000064, 0x00000065, 0x0004009c, 0x0000004a, 0x00000067, 0x00000066, 0x000600a9, 0x0000003c,
    0x00000068, 0x00000067, 0x0000004c, 0x0000004d, 0x00060041, 0x00000044, 0x00000069, 0x00000041,
    0x00000011, 0x00000062, 0x0003003e, 0x00000069, 0x00000068, 0x000100fd, 0x00010038,
]

pub let ieee_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct In\n{\n    float zero;\n    float one;\n    float low;\n    float high;\n};\n\nstruct Out\n{\n    uint results[8];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);\n\nkernel void luce_compute(device In& v [[buffer(0)]], device Out& o [[buffer(1)]])\n{\n    float positive = v.one / v.zero;\n    float negative = (-v.one) / v.zero;\n    float nan = v.zero / v.zero;\n    float near = fast::min(v.low / v.zero, v.high / v.zero);\n    float far = fast::max(v.low / v.zero, v.high / v.zero);\n    o.results[0] = as_type<uint>(positive);\n    o.results[1] = as_type<uint>(negative);\n    o.results[2] = uint(isnan(nan));\n    o.results[3] = uint(isinf(positive));\n    o.results[4] = uint(nan != nan);\n    o.results[5] = as_type<uint>(near);\n    o.results[6] = as_type<uint>(far);\n    o.results[7] = uint(isnan(v.zero * positive));\n}\n\n"
pub let ieee_comp_group: u32[3] = [1, 1, 1]
pub let ieee_comp_bindings: u8[16] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let ieee_comp_fast_math: bool = false
pub let ieee_comp_table: bool = false

# mark: ieee_fast: compute kernel =============================================================

pub let ieee_fast_comp_words: u32[687] = [
    0x07230203, 0x00010500, 0x0008000b, 0x0000006c, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x0007000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000041, 0x00060010,
    0x00000004, 0x00000011, 0x00000001, 0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2,
    0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00050005, 0x00000008, 0x69736f70, 0x65766974,
    0x00000000, 0x00030005, 0x00000009, 0x00006e49, 0x00050006, 0x00000009, 0x00000000, 0x6f72657a,
    0x00000000, 0x00040006, 0x00000009, 0x00000001, 0x00656e6f, 0x00040006, 0x00000009, 0x00000002,
    0x00776f6c, 0x00050006, 0x00000009, 0x00000003, 0x68676968, 0x00000000, 0x00030005, 0x0000000b,
    0x00000076, 0x00050005, 0x00000015, 0x6167656e, 0x65766974, 0x00000000, 0x00030005, 0x0000001c,
    0x006e616e, 0x00040005, 0x00000022, 0x7261656e, 0x00000000, 0x00030005, 0x00000030, 0x00726166,
    0x00030005, 0x0000003f, 0x0074754f, 0x00050006, 0x0000003f, 0x00000000, 0x75736572, 0x0073746c,
    0x00030005, 0x00000041, 0x0000006f, 0x00030047, 0x00000009, 0x00000002, 0x00040048, 0x00000009,
    0x00000000, 0x00000018, 0x00050048, 0x00000009, 0x00000000, 0x00000023, 0x00000000, 0x00040048,
    0x00000009, 0x00000001, 0x00000018, 0x00050048, 0x00000009, 0x00000001, 0x00000023, 0x00000004,
    0x00040048, 0x00000009, 0x00000002, 0x00000018, 0x00050048, 0x00000009, 0x00000002, 0x00000023,
    0x00000008, 0x00040048, 0x00000009, 0x00000003, 0x00000018, 0x00050048, 0x00000009, 0x00000003,
    0x00000023, 0x0000000c, 0x00030047, 0x0000000b, 0x00000018, 0x00040047, 0x0000000b, 0x00000021,
    0x00000000, 0x00040047, 0x0000000b, 0x00000022, 0x00000000, 0x00040047, 0x0000003e, 0x00000006,
    0x00000004, 0x00030047, 0x0000003f, 0x00000002, 0x00040048, 0x0000003f, 0x00000000, 0x00000019,
    0x00050048, 0x0000003f, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000041, 0x00000019,
    0x00040047, 0x00000041, 0x00000021, 0x00000001, 0x00040047, 0x00000041, 0x00000022, 0x00000000,
    0x00040047, 0x0000006b, 0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021, 0x00000003,
    0x00000002, 0x00030016, 0x00000006, 0x00000020, 0x00040020, 0x00000007, 0x00000007, 0x00000006,
    0x0006001e, 0x00000009, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00040020, 0x0000000a,
    0x0000000c, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x0000000c, 0x00040015, 0x0000000c,
    0x00000020, 0x00000001, 0x0004002b, 0x0000000c, 0x0000000d, 0x00000001, 0x00040020, 0x0000000e,
    0x0000000c, 0x00000006, 0x0004002b, 0x0000000c, 0x00000011, 0x00000000, 0x0004002b, 0x0000000c,
    0x00000023, 0x00000002, 0x0004002b, 0x0000000c, 0x00000029, 0x00000003, 0x00040015, 0x0000003c,
    0x00000020, 0x00000000, 0x0004002b, 0x0000003c, 0x0000003d, 0x00000008, 0x0004001c, 0x0000003e,
    0x0000003c, 0x0000003d, 0x0003001e, 0x0000003f, 0x0000003e, 0x00040020, 0x00000040, 0x0000000c,
    0x0000003f, 0x0004003b, 0x00000040, 0x00000041, 0x0000000c, 0x00040020, 0x00000044, 0x0000000c,
    0x0000003c, 0x00020014, 0x0000004a, 0x0004002b, 0x0000003c, 0x0000004c, 0x00000001, 0x0004002b,
    0x0000003c, 0x0000004d, 0x00000000, 0x0004002b, 0x0000000c, 0x00000054, 0x00000004, 0x0004002b,
    0x0000000c, 0x0000005a, 0x00000005, 0x0004002b, 0x0000000c, 0x0000005e, 0x00000006, 0x0004002b,
    0x0000000c, 0x00000062, 0x00000007, 0x00040017, 0x0000006a, 0x0000003c, 0x00000003, 0x0006002c,
    0x0000006a, 0x0000006b, 0x0000004c, 0x0000004c, 0x0000004c, 0x00050036, 0x00000002, 0x00000004,
    0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x00000007, 0x00000008, 0x00000007,
    0x0004003b, 0x00000007, 0x00000015, 0x00000007, 0x0004003b, 0x00000007, 0x0000001c, 0x00000007,
    0x0004003b, 0x00000007, 0x00000022, 0x00000007, 0x0004003b, 0x00000007, 0x00000030, 0x00000007,
    0x00050041, 0x0000000e, 0x0000000f, 0x0000000b, 0x0000000d, 0x0004003d, 0x00000006, 0x00000010,
    0x0000000f, 0x00050041, 0x0000000e, 0x00000012, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006,
    0x00000013, 0x00000012, 0x00050088, 0x00000006, 0x00000014, 0x00000010, 0x00000013, 0x0003003e,
    0x00000008, 0x00000014, 0x00050041, 0x0000000e, 0x00000016, 0x0000000b, 0x0000000d, 0x0004003d,
    0x00000006, 0x00000017, 0x00000016, 0x0004007f, 0x00000006, 0x00000018, 0x00000017, 0x00050041,
    0x0000000e, 0x00000019, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006, 0x0000001a, 0x00000019,
    0x00050088, 0x00000006, 0x0000001b, 0x00000018, 0x0000001a, 0x0003003e, 0x00000015, 0x0000001b,
    0x00050041, 0x0000000e, 0x0000001d, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006, 0x0000001e,
    0x0000001d, 0x00050041, 0x0000000e, 0x0000001f, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006,
    0x00000020, 0x0000001f, 0x00050088, 0x00000006, 0x00000021, 0x0000001e, 0x00000020, 0x0003003e,
    0x0000001c, 0x00000021, 0x00050041, 0x0000000e, 0x00000024, 0x0000000b, 0x00000023, 0x0004003d,
    0x00000006, 0x00000025, 0x00000024, 0x00050041, 0x0000000e, 0x00000026, 0x0000000b, 0x00000011,
    0x0004003d, 0x00000006, 0x00000027, 0x00000026, 0x00050088, 0x00000006, 0x00000028, 0x00000025,
    0x00000027, 0x00050041, 0x0000000e, 0x0000002a, 0x0000000b, 0x00000029, 0x0004003d, 0x00000006,
    0x0000002b, 0x0000002a, 0x00050041, 0x0000000e, 0x0000002c, 0x0000000b, 0x00000011, 0x0004003d,
    0x00000006, 0x0000002d, 0x0000002c, 0x00050088, 0x00000006, 0x0000002e, 0x0000002b, 0x0000002d,
    0x0007000c, 0x00000006, 0x0000002f, 0x00000001, 0x00000025, 0x00000028, 0x0000002e, 0x0003003e,
    0x00000022, 0x0000002f, 0x00050041, 0x0000000e, 0x00000031, 0x0000000b, 0x00000023, 0x0004003d,
    0x00000006, 0x00000032, 0x00000031, 0x00050041, 0x0000000e, 0x00000033, 0x0000000b, 0x00000011,
    0x0004003d, 0x00000006, 0x00000034, 0x00000033, 0x00050088, 0x00000006, 0x00000035, 0x00000032,
    0x00000034, 0x00050041, 0x0000000e, 0x00000036, 0x0000000b, 0x00000029, 0x0004003d, 0x00000006,
    0x00000037, 0x00000036, 0x00050041, 0x0000000e, 0x00000038, 0x0000000b, 0x00000011, 0x0004003d,
    0x00000006, 0x00000039, 0x00000038, 0x00050088, 0x00000006, 0x0000003a, 0x00000037, 0x00000039,
    0x0007000c, 0x00000006, 0x0000003b, 0x00000001, 0x00000028, 0x00000035, 0x0000003a, 0x0003003e,
    0x00000030, 0x0000003b, 0x0004003d, 0x00000006, 0x00000042, 0x00000008, 0x0004007c, 0x0000003c,
    0x00000043, 0x00000042, 0x00060041, 0x00000044, 0x00000045, 0x00000041, 0x00000011, 0x00000011,
    0x0003003e, 0x00000045, 0x00000043, 0x0004003d, 0x00000006, 0x00000046, 0x00000015, 0x0004007c,
    0x0000003c, 0x00000047, 0x00000046, 0x00060041, 0x00000044, 0x00000048, 0x00000041, 0x00000011,
    0x0000000d, 0x0003003e, 0x00000048, 0x00000047, 0x0004003d, 0x00000006, 0x00000049, 0x0000001c,
    0x0004009c, 0x0000004a, 0x0000004b, 0x00000049, 0x000600a9, 0x0000003c, 0x0000004e, 0x0000004b,
    0x0000004c, 0x0000004d, 0x00060041, 0x00000044, 0x0000004f, 0x00000041, 0x00000011, 0x00000023,
    0x0003003e, 0x0000004f, 0x0000004e, 0x0004003d, 0x00000006, 0x00000050, 0x00000008, 0x0004009d,
    0x0000004a, 0x00000051, 0x00000050, 0x000600a9, 0x0000003c, 0x00000052, 0x00000051, 0x0000004c,
    0x0000004d, 0x00060041, 0x00000044, 0x00000053, 0x00000041, 0x00000011, 0x00000029, 0x0003003e,
    0x00000053, 0x00000052, 0x0004003d, 0x00000006, 0x00000055, 0x0000001c, 0x0004003d, 0x00000006,
    0x00000056, 0x0000001c, 0x000500b7, 0x0000004a, 0x00000057, 0x00000055, 0x00000056, 0x000600a9,
    0x0000003c, 0x00000058, 0x00000057, 0x0000004c, 0x0000004d, 0x00060041, 0x00000044, 0x00000059,
    0x00000041, 0x00000011, 0x00000054, 0x0003003e, 0x00000059, 0x00000058, 0x0004003d, 0x00000006,
    0x0000005b, 0x00000022, 0x0004007c, 0x0000003c, 0x0000005c, 0x0000005b, 0x00060041, 0x00000044,
    0x0000005d, 0x00000041, 0x00000011, 0x0000005a, 0x0003003e, 0x0000005d, 0x0000005c, 0x0004003d,
    0x00000006, 0x0000005f, 0x00000030, 0x0004007c, 0x0000003c, 0x00000060, 0x0000005f, 0x00060041,
    0x00000044, 0x00000061, 0x00000041, 0x00000011, 0x0000005e, 0x0003003e, 0x00000061, 0x00000060,
    0x00050041, 0x0000000e, 0x00000063, 0x0000000b, 0x00000011, 0x0004003d, 0x00000006, 0x00000064,
    0x00000063, 0x0004003d, 0x00000006, 0x00000065, 0x00000008, 0x00050085, 0x00000006, 0x00000066,
    0x00000064, 0x00000065, 0x0004009c, 0x0000004a, 0x00000067, 0x00000066, 0x000600a9, 0x0000003c,
    0x00000068, 0x00000067, 0x0000004c, 0x0000004d, 0x00060041, 0x00000044, 0x00000069, 0x00000041,
    0x00000011, 0x00000062, 0x0003003e, 0x00000069, 0x00000068, 0x000100fd, 0x00010038,
]

pub let ieee_fast_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct In\n{\n    float zero;\n    float one;\n    float low;\n    float high;\n};\n\nstruct Out\n{\n    uint results[8];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);\n\nkernel void luce_compute(device In& v [[buffer(0)]], device Out& o [[buffer(1)]])\n{\n    float positive = v.one / v.zero;\n    float negative = (-v.one) / v.zero;\n    float nan = v.zero / v.zero;\n    float near = fast::min(v.low / v.zero, v.high / v.zero);\n    float far = fast::max(v.low / v.zero, v.high / v.zero);\n    o.results[0] = as_type<uint>(positive);\n    o.results[1] = as_type<uint>(negative);\n    o.results[2] = uint(isnan(nan));\n    o.results[3] = uint(isinf(positive));\n    o.results[4] = uint(nan != nan);\n    o.results[5] = as_type<uint>(near);\n    o.results[6] = as_type<uint>(far);\n    o.results[7] = uint(isnan(v.zero * positive));\n}\n\n"
pub let ieee_fast_comp_group: u32[3] = [1, 1, 1]
pub let ieee_fast_comp_bindings: u8[16] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let ieee_fast_comp_fast_math: bool = true
pub let ieee_fast_comp_table: bool = false

# mark: subgroup: compute kernel ==============================================================

pub let subgroup_comp_words: u32[440] = [
    0x07230203, 0x00010500, 0x0008000b, 0x0000003a, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
    0x0000003d, 0x00020011, 0x0000003e, 0x00020011, 0x0000003f, 0x00020011, 0x00000040, 0x00020011,
    0x00000041, 0x0006000b, 0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,
    0x00000000, 0x00000001, 0x0008000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b,
    0x00000029, 0x0000002d, 0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001,
    0x00030003, 0x00000002, 0x000001c2, 0x000a0004, 0x4b5f4c47, 0x735f5248, 0x65646168, 0x75735f72,
    0x6f726762, 0x615f7075, 0x68746972, 0x6974656d, 0x00000063, 0x00090004, 0x4b5f4c47, 0x735f5248,
    0x65646168, 0x75735f72, 0x6f726762, 0x625f7075, 0x6f6c6c61, 0x00000074, 0x00090004, 0x4b5f4c47,
    0x735f5248, 0x65646168, 0x75735f72, 0x6f726762, 0x625f7075, 0x63697361, 0x00000000, 0x00090004,
    0x4b5f4c47, 0x735f5248, 0x65646168, 0x75735f72, 0x6f726762, 0x735f7075, 0x66667568, 0x0000656c,
    0x00080004, 0x4b5f4c47, 0x735f5248, 0x65646168, 0x75735f72, 0x6f726762, 0x765f7075, 0x0065746f,
    0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005, 0x00000008, 0x00000069, 0x00080005,
    0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044, 0x00040005,
    0x00000010, 0x65646461, 0x00000064, 0x00050005, 0x00000014, 0x6c6c6162, 0x6465746f, 0x00000000,
    0x00050005, 0x0000001b, 0x66756873, 0x64656c66, 0x00000000, 0x00040005, 0x00000021, 0x65746f76,
    0x00000064, 0x00030005, 0x00000027, 0x0074754f, 0x00050006, 0x00000027, 0x00000000, 0x75736572,
    0x0073746c, 0x00030005, 0x00000029, 0x00000000, 0x00060005, 0x0000002d, 0x535f6c67, 0x72676275,
    0x5370756f, 0x00657a69, 0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00040047, 0x00000026,
    0x00000006, 0x00000010, 0x00030047, 0x00000027, 0x00000002, 0x00040048, 0x00000027, 0x00000000,
    0x00000019, 0x00050048, 0x00000027, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000029,
    0x00000019, 0x00040047, 0x00000029, 0x00000021, 0x00000000, 0x00040047, 0x00000029, 0x00000022,
    0x00000000, 0x00030047, 0x0000002d, 0x00000000, 0x00040047, 0x0000002d, 0x0000000b, 0x00000024,
    0x00030047, 0x0000002e, 0x00000000, 0x00040047, 0x00000039, 0x0000000b, 0x00000019, 0x00020013,
    0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000,
    0x00040020, 0x00000007, 0x00000007, 0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003,
    0x00040020, 0x0000000a, 0x00000001, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001,
    0x0004002b, 0x00000006, 0x0000000c, 0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006,
    0x0004002b, 0x00000006, 0x00000011, 0x00000001, 0x0004002b, 0x00000006, 0x00000012, 0x00000003,
    0x00020014, 0x00000015, 0x00030029, 0x00000015, 0x00000016, 0x00040017, 0x00000017, 0x00000006,
    0x00000004, 0x00040020, 0x0000001a, 0x00000007, 0x00000015, 0x0004002b, 0x00000006, 0x00000023,
    0x000f4240, 0x0003001d, 0x00000026, 0x00000017, 0x0003001e, 0x00000027, 0x00000026, 0x00040020,
    0x00000028, 0x0000000c, 0x00000027, 0x0004003b, 0x00000028, 0x00000029, 0x0000000c, 0x00040015,
    0x0000002a, 0x00000020, 0x00000001, 0x0004002b, 0x0000002a, 0x0000002b, 0x00000000, 0x0004003b,
    0x0000000d, 0x0000002d, 0x00000001, 0x00040020, 0x00000036, 0x0000000c, 0x00000017, 0x0004002b,
    0x00000006, 0x00000038, 0x00000040, 0x0006002c, 0x00000009, 0x00000039, 0x00000038, 0x00000011,
    0x00000011, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005,
    0x0004003b, 0x00000007, 0x00000008, 0x00000007, 0x0004003b, 0x00000007, 0x00000010, 0x00000007,
    0x0004003b, 0x00000007, 0x00000014, 0x00000007, 0x0004003b, 0x0000001a, 0x0000001b, 0x00000007,
    0x0004003b, 0x0000001a, 0x00000021, 0x00000007, 0x00050041, 0x0000000d, 0x0000000e, 0x0000000b,
    0x0000000c, 0x0004003d, 0x00000006, 0x0000000f, 0x0000000e, 0x0003003e, 0x00000008, 0x0000000f,
    0x0006015d, 0x00000006, 0x00000013, 0x00000012, 0x00000000, 0x00000011, 0x0003003e, 0x00000010,
    0x00000013, 0x00050153, 0x00000017, 0x00000018, 0x00000012, 0x00000016, 0x00060156, 0x00000006,
    0x00000019, 0x00000012, 0x00000000, 0x00000018, 0x0003003e, 0x00000014, 0x00000019, 0x0004003d,
    0x00000006, 0x0000001c, 0x00000008, 0x00060159, 0x00000006, 0x0000001d, 0x00000012, 0x0000001c,
    0x0000000c, 0x0004003d, 0x00000006, 0x0000001e, 0x00000008, 0x00050152, 0x00000006, 0x0000001f,
    0x00000012, 0x0000001e, 0x000500aa, 0x00000015, 0x00000020, 0x0000001d, 0x0000001f, 0x0003003e,
    0x0000001b, 0x00000020, 0x0004003d, 0x00000006, 0x00000022, 0x00000008, 0x000500b0, 0x00000015,
    0x00000024, 0x00000022, 0x00000023, 0x0005014e, 0x00000015, 0x00000025, 0x00000012, 0x00000024,
    0x0003003e, 0x00000021, 0x00000025, 0x0004003d, 0x00000006, 0x0000002c, 0x00000008, 0x0004003d,
    0x00000006, 0x0000002e, 0x0000002d, 0x0004003d, 0x00000006, 0x0000002f, 0x00000010, 0x0004003d,
    0x00000006, 0x00000030, 0x00000014, 0x0004003d, 0x00000015, 0x00000031, 0x0000001b, 0x0004003d,
    0x00000015, 0x00000032, 0x00000021, 0x000500a7, 0x00000015, 0x00000033, 0x00000031, 0x00000032,
    0x000600a9, 0x00000006, 0x00000034, 0x00000033, 0x00000011, 0x0000000c, 0x00070050, 0x00000017,
    0x00000035, 0x0000002e, 0x0000002f, 0x00000030, 0x00000034, 0x00060041, 0x00000036, 0x00000037,
    0x00000029, 0x0000002b, 0x0000002c, 0x0003003e, 0x00000037, 0x00000035, 0x000100fd, 0x00010038,
]

pub let subgroup_comp_msl: c.str = "#pragma clang diagnostic ignored \"-Wmissing-prototypes\"\n\n#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\ntemplate<typename T>\ninline T spvSubgroupBroadcastFirst(T value)\n{\n    return simd_broadcast_first(value);\n}\n\ntemplate<>\ninline bool spvSubgroupBroadcastFirst(bool value)\n{\n    return !!simd_broadcast_first((ushort)value);\n}\n\ntemplate<uint N>\ninline vec<bool, N> spvSubgroupBroadcastFirst(vec<bool, N> value)\n{\n    return (vec<bool, N>)simd_broadcast_first((vec<ushort, N>)value);\n}\n\ninline uint4 spvSubgroupBallot(bool value)\n{\n    simd_vote vote = simd_ballot(value);\n    // simd_ballot() returns a 64-bit integer-like object, but\n    // SPIR-V callers expect a uint4. We must convert.\n    // FIXME: This won't include higher bits if Apple ever supports\n    // 128 lanes in an SIMD-group.\n    return uint4(as_type<uint2>((simd_vote::vote_t)vote), 0, 0);\n}\n\ninline uint spvPopCount4(uint4 ballot)\n{\n    return popcount(ballot.x) + popcount(ballot.y) + popcount(ballot.z) + popcount(ballot.w);\n}\n\ninline uint spvSubgroupBallotBitCount(uint4 ballot, uint gl_SubgroupSize)\n{\n    uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupSize, 32u)), extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupSize - 32, 0)), uint2(0));\n    return spvPopCount4(ballot & mask);\n}\n\ninline uint spvSubgroupBallotInclusiveBitCount(uint4 ballot, uint gl_SubgroupInvocationID)\n{\n    uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupInvocationID + 1, 32u)), extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupInvocationID + 1 - 32, 0)), uint2(0));\n    return spvPopCount4(ballot & mask);\n}\n\ninline uint spvSubgroupBallotExclusiveBitCount(uint4 ballot, uint gl_SubgroupInvocationID)\n{\n    uint4 mask = uint4(extract_bits(0xFFFFFFFF, 0, min(gl_SubgroupInvocationID, 32u)), extract_bits(0xFFFFFFFF, 0, (uint)max((int)gl_SubgroupInvocationID - 32, 0)), uint2(0));\n    return spvPopCount4(ballot & mask);\n}\n\ntemplate<typename T>\ninline T spvSubgroupShuffle(T value, ushort lane)\n{\n    return simd_shuffle(value, lane);\n}\n\ntemplate<>\ninline bool spvSubgroupShuffle(bool value, ushort lane)\n{\n    return !!simd_shuffle((ushort)value, lane);\n}\n\ntemplate<uint N>\ninline vec<bool, N> spvSubgroupShuffle(vec<bool, N> value, ushort lane)\n{\n    return (vec<bool, N>)simd_shuffle((vec<ushort, N>)value, lane);\n}\n\ntemplate<>\ninline ulong spvSubgroupShuffle(ulong value, ushort lane)\n{\n    return as_type<ulong>(spvSubgroupShuffle(as_type<uint2>(value), lane));\n}\n\ntemplate<>\ninline ulong2 spvSubgroupShuffle(ulong2 value, ushort lane)\n{\n    return ulong2(spvSubgroupShuffle(value.x, lane), spvSubgroupShuffle(value.y, lane));\n}\n\ninline ulong3 spvSubgroupShuffle(ulong3 value, ushort lane)\n{\n    return ulong3(spvSubgroupShuffle(value.xy, lane), spvSubgroupShuffle(value.z, lane));\n}\n\ninline ulong4 spvSubgroupShuffle(ulong4 value, ushort lane)\n{\n    return ulong4(spvSubgroupShuffle(value.xy, lane), spvSubgroupShuffle(value.zw, lane));\n}\n\ntemplate<uint N>\ninline vec<long, N> spvSubgroupShuffle(vec<long, N> value, ushort lane)\n{\n    return vec<long, N>(spvSubgroupShuffle(vec<ulong, N>(value), lane));\n}\n\nstruct Out\n{\n    uint4 results[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(device Out& _41 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_SubgroupSize [[threads_per_simdgroup]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    uint added = simd_sum(1u);\n    uint balloted = spvSubgroupBallotBitCount(spvSubgroupBallot(true), gl_SubgroupSize);\n    bool shuffled = spvSubgroupShuffle(i, 0u) == spvSubgroupBroadcastFirst(i);\n    bool voted = simd_all(i < 1000000u);\n    _41.results[i] = uint4(gl_SubgroupSize, added, balloted, uint(shuffled && voted));\n}\n\n"
pub let subgroup_comp_group: u32[3] = [64, 1, 1]
pub let subgroup_comp_bindings: u8[16] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let subgroup_comp_fast_math: bool = false
pub let subgroup_comp_table: bool = false

# mark: addresses: compute kernel =============================================================

pub let addresses_comp_words: u32[488] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000043, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
    0x0000000b, 0x00020011, 0x000014e3, 0x0006000b, 0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e,
    0x00000000, 0x0003000e, 0x000014e4, 0x00000001, 0x0008000f, 0x00000005, 0x00000004, 0x6e69616d,
    0x00000000, 0x0000000b, 0x00000017, 0x0000002b, 0x00060010, 0x00000004, 0x00000011, 0x00000040,
    0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2, 0x00070004, 0x455f4c47, 0x625f5458,
    0x65666675, 0x65725f72, 0x65726566, 0x0065636e, 0x000d0004, 0x455f4c47, 0x735f5458, 0x65646168,
    0x78655f72, 0x63696c70, 0x615f7469, 0x68746972, 0x6974656d, 0x79745f63, 0x5f736570, 0x36746e69,
    0x00000034, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005, 0x00000008, 0x00000069,
    0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044,
    0x00040005, 0x00000012, 0x61726150, 0x0000736d, 0x00050006, 0x00000012, 0x00000000, 0x75736572,
    0x0073746c, 0x00040006, 0x00000012, 0x00000001, 0x0000006e, 0x00040005, 0x00000015, 0x75736552,
    0x0073746c, 0x00050006, 0x00000015, 0x00000000, 0x75736572, 0x0073746c, 0x00040005, 0x00000017,
    0x61726170, 0x0000736d, 0x00040005, 0x00000024, 0x756c6156, 0x00007365, 0x00050006, 0x00000024,
    0x00000000, 0x756c6176, 0x00007365, 0x00040005, 0x00000026, 0x72756f73, 0x00006563, 0x00040005,
    0x00000029, 0x6c626154, 0x00000065, 0x00050006, 0x00000029, 0x00000000, 0x72756f73, 0x00736563,
    0x00030005, 0x0000002b, 0x00000000, 0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00030047,
    0x00000012, 0x00000002, 0x00050048, 0x00000012, 0x00000000, 0x00000023, 0x00000000, 0x00050048,
    0x00000012, 0x00000001, 0x00000023, 0x00000008, 0x00040047, 0x00000014, 0x00000006, 0x00000004,
    0x00030047, 0x00000015, 0x00000002, 0x00040048, 0x00000015, 0x00000000, 0x00000019, 0x00050048,
    0x00000015, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000023, 0x00000006, 0x00000004,
    0x00030047, 0x00000024, 0x00000002, 0x00040048, 0x00000024, 0x00000000, 0x00000018, 0x00050048,
    0x00000024, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000026, 0x000014ec, 0x00040047,
    0x00000028, 0x00000006, 0x00000008, 0x00030047, 0x00000029, 0x00000002, 0x00040048, 0x00000029,
    0x00000000, 0x00000018, 0x00050048, 0x00000029, 0x00000000, 0x00000023, 0x00000000, 0x00030047,
    0x0000002b, 0x00000018, 0x00040047, 0x0000002b, 0x00000021, 0x00000000, 0x00040047, 0x0000002b,
    0x00000022, 0x00000000, 0x00040047, 0x00000042, 0x0000000b, 0x00000019, 0x00020013, 0x00000002,
    0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020,
    0x00000007, 0x00000007, 0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020,
    0x0000000a, 0x00000001, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b,
    0x00000006, 0x0000000c, 0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x00030027,
    0x00000011, 0x000014e5, 0x0004001e, 0x00000012, 0x00000011, 0x00000006, 0x00030016, 0x00000013,
    0x00000020, 0x0003001d, 0x00000014, 0x00000013, 0x0003001e, 0x00000015, 0x00000014, 0x00040020,
    0x00000011, 0x000014e5, 0x00000015, 0x00040020, 0x00000016, 0x00000009, 0x00000012, 0x0004003b,
    0x00000016, 0x00000017, 0x00000009, 0x00040015, 0x00000018, 0x00000020, 0x00000001, 0x0004002b,
    0x00000018, 0x00000019, 0x00000001, 0x00040020, 0x0000001a, 0x00000009, 0x00000006, 0x00020014,
    0x0000001d, 0x00030027, 0x00000022, 0x000014e5, 0x0003001d, 0x00000023, 0x00000013, 0x0003001e,
    0x00000024, 0x00000023, 0x00040020, 0x00000022, 0x000014e5, 0x00000024, 0x00040020, 0x00000025,
    0x00000007, 0x00000022, 0x00040015, 0x00000027, 0x00000040, 0x00000000, 0x0003001d, 0x00000028,
    0x00000027, 0x0003001e, 0x00000029, 0x00000028, 0x00040020, 0x0000002a, 0x0000000c, 0x00000029,
    0x0004003b, 0x0000002a, 0x0000002b, 0x0000000c, 0x0004002b, 0x00000018, 0x0000002c, 0x00000000,
    0x0004002b, 0x00000006, 0x0000002e, 0x00000002, 0x00040020, 0x00000030, 0x0000000c, 0x00000027,
    0x00040020, 0x00000034, 0x00000009, 0x00000011, 0x00040020, 0x0000003a, 0x000014e5, 0x00000013,
    0x0004002b, 0x00000013, 0x0000003d, 0x40000000, 0x0004002b, 0x00000006, 0x00000040, 0x00000040,
    0x0004002b, 0x00000006, 0x00000041, 0x00000001, 0x0006002c, 0x00000009, 0x00000042, 0x00000040,
    0x00000041, 0x00000041, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8,
    0x00000005, 0x0004003b, 0x00000007, 0x00000008, 0x00000007, 0x0004003b, 0x00000025, 0x00000026,
    0x00000007, 0x00050041, 0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c, 0x0004003d, 0x00000006,
    0x0000000f, 0x0000000e, 0x0003003e, 0x00000008, 0x0000000f, 0x0004003d, 0x00000006, 0x00000010,
    0x00000008, 0x00050041, 0x0000001a, 0x0000001b, 0x00000017, 0x00000019, 0x0004003d, 0x00000006,
    0x0000001c, 0x0000001b, 0x000500ae, 0x0000001d, 0x0000001e, 0x00000010, 0x0000001c, 0x000300f7,
    0x00000020, 0x00000000, 0x000400fa, 0x0000001e, 0x0000001f, 0x00000020, 0x000200f8, 0x0000001f,
    0x000100fd, 0x000200f8, 0x00000020, 0x0004003d, 0x00000006, 0x0000002d, 0x00000008, 0x00050089,
    0x00000006, 0x0000002f, 0x0000002d, 0x0000002e, 0x00060041, 0x00000030, 0x00000031, 0x0000002b,
    0x0000002c, 0x0000002f, 0x0004003d, 0x00000027, 0x00000032, 0x00000031, 0x00040078, 0x00000022,
    0x00000033, 0x00000032, 0x0003003e, 0x00000026, 0x00000033, 0x00050041, 0x00000034, 0x00000035,
    0x00000017, 0x0000002c, 0x0004003d, 0x00000011, 0x00000036, 0x00000035, 0x0004003d, 0x00000006,
    0x00000037, 0x00000008, 0x0004003d, 0x00000022, 0x00000038, 0x00000026, 0x0004003d, 0x00000006,
    0x00000039, 0x00000008, 0x00060041, 0x0000003a, 0x0000003b, 0x00000038, 0x0000002c, 0x00000039,
    0x0006003d, 0x00000013, 0x0000003c, 0x0000003b, 0x00000002, 0x00000004, 0x00050085, 0x00000013,
    0x0000003e, 0x0000003c, 0x0000003d, 0x00060041, 0x0000003a, 0x0000003f, 0x00000036, 0x0000002c,
    0x00000037, 0x0005003e, 0x0000003f, 0x0000003e, 0x00000002, 0x00000004, 0x000100fd, 0x00010038,
]

pub let addresses_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct Results;\nstruct Values;\n\nstruct Params\n{\n    device Results* results;\n    uint n;\n};\n\nstruct Results\n{\n    float results[1];\n};\n\nstruct Values\n{\n    float values[1];\n};\n\nstruct Table\n{\n    ulong sources[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(constant Params& params [[buffer(30)]], device Table& _43 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    if (i >= params.n)\n    {\n        return;\n    }\n    device Values* source = reinterpret_cast<device Values*>(_43.sources[i % 2u]);\n    params.results->results[i] = source->values[i] * 2.0;\n}\n\n"
pub let addresses_comp_group: u32[3] = [64, 1, 1]
pub let addresses_comp_bindings: u8[16] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let addresses_comp_fast_math: bool = false
pub let addresses_comp_table: bool = false

# mark: table: compute kernel =================================================================

pub let table_comp_words: u32[486] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000045, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
    0x000014b5, 0x00020011, 0x000014b6, 0x00020011, 0x000014bb, 0x0006000b, 0x00000001, 0x4c534c47,
    0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x000b000f, 0x00000005,
    0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000013, 0x00000023, 0x00000028, 0x0000002c,
    0x00000037, 0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001, 0x00030003,
    0x00000002, 0x000001c2, 0x00080004, 0x455f4c47, 0x6e5f5458, 0x6e756e6f, 0x726f6669, 0x75715f6d,
    0x66696c61, 0x00726569, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005, 0x00000008,
    0x00000069, 0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69,
    0x00000044, 0x00040005, 0x00000011, 0x61726150, 0x0000736d, 0x00040006, 0x00000011, 0x00000000,
    0x0000006e, 0x00040005, 0x00000013, 0x61726170, 0x0000736d, 0x00040005, 0x00000021, 0x6f6c6f43,
    0x00007372, 0x00050006, 0x00000021, 0x00000000, 0x6f6c6f63, 0x00007372, 0x00030005, 0x00000023,
    0x00000000, 0x00050005, 0x00000028, 0x74786574, 0x73657275, 0x00000000, 0x00050005, 0x0000002a,
    0x6574614d, 0x6c616972, 0x00000073, 0x00050006, 0x0000002a, 0x00000000, 0x746f6c73, 0x00000073,
    0x00030005, 0x0000002c, 0x00000000, 0x00040005, 0x00000037, 0x6e696f70, 0x00000074, 0x00040047,
    0x0000000b, 0x0000000b, 0x0000001c, 0x00030047, 0x00000011, 0x00000002, 0x00050048, 0x00000011,
    0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000020, 0x00000006, 0x00000010, 0x00030047,
    0x00000021, 0x00000002, 0x00040048, 0x00000021, 0x00000000, 0x00000019, 0x00050048, 0x00000021,
    0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000023, 0x00000019, 0x00040047, 0x00000023,
    0x00000021, 0x00000001, 0x00040047, 0x00000023, 0x00000022, 0x00000000, 0x00040047, 0x00000028,
    0x00000021, 0x00000000, 0x00040047, 0x00000028, 0x00000022, 0x00000001, 0x00040047, 0x00000029,
    0x00000006, 0x00000004, 0x00030047, 0x0000002a, 0x00000002, 0x00040048, 0x0000002a, 0x00000000,
    0x00000018, 0x00050048, 0x0000002a, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x0000002c,
    0x00000018, 0x00040047, 0x0000002c, 0x00000021, 0x00000000, 0x00040047, 0x0000002c, 0x00000022,
    0x00000000, 0x00030047, 0x00000031, 0x000014b4, 0x00030047, 0x00000033, 0x000014b4, 0x00030047,
    0x00000034, 0x000014b4, 0x00040047, 0x00000037, 0x00000021, 0x00000002, 0x00040047, 0x00000037,
    0x00000022, 0x00000000, 0x00040047, 0x00000044, 0x0000000b, 0x00000019, 0x00020013, 0x00000002,
    0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020,
    0x00000007, 0x00000007, 0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020,
    0x0000000a, 0x00000001, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b,
    0x00000006, 0x0000000c, 0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x0003001e,
    0x00000011, 0x00000006, 0x00040020, 0x00000012, 0x00000009, 0x00000011, 0x0004003b, 0x00000012,
    0x00000013, 0x00000009, 0x00040015, 0x00000014, 0x00000020, 0x00000001, 0x0004002b, 0x00000014,
    0x00000015, 0x00000000, 0x00040020, 0x00000016, 0x00000009, 0x00000006, 0x00020014, 0x00000019,
    0x00030016, 0x0000001e, 0x00000020, 0x00040017, 0x0000001f, 0x0000001e, 0x00000004, 0x0003001d,
    0x00000020, 0x0000001f, 0x0003001e, 0x00000021, 0x00000020, 0x00040020, 0x00000022, 0x0000000c,
    0x00000021, 0x0004003b, 0x00000022, 0x00000023, 0x0000000c, 0x00090019, 0x00000025, 0x0000001e,
    0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x0003001d, 0x00000026,
    0x00000025, 0x00040020, 0x00000027, 0x00000000, 0x00000026, 0x0004003b, 0x00000027, 0x00000028,
    0x00000000, 0x0003001d, 0x00000029, 0x00000006, 0x0003001e, 0x0000002a, 0x00000029, 0x00040020,
    0x0000002b, 0x0000000c, 0x0000002a, 0x0004003b, 0x0000002b, 0x0000002c, 0x0000000c, 0x00040020,
    0x0000002e, 0x0000000c, 0x00000006, 0x00040020, 0x00000032, 0x00000000, 0x00000025, 0x0002001a,
    0x00000035, 0x00040020, 0x00000036, 0x00000000, 0x00000035, 0x0004003b, 0x00000036, 0x00000037,
    0x00000000, 0x0003001b, 0x00000039, 0x00000025, 0x00040017, 0x0000003b, 0x0000001e, 0x00000002,
    0x0004002b, 0x0000001e, 0x0000003c, 0x3f000000, 0x0005002c, 0x0000003b, 0x0000003d, 0x0000003c,
    0x0000003c, 0x0004002b, 0x0000001e, 0x0000003e, 0x00000000, 0x00040020, 0x00000040, 0x0000000c,
    0x0000001f, 0x0004002b, 0x00000006, 0x00000042, 0x00000040, 0x0004002b, 0x00000006, 0x00000043,
    0x00000001, 0x0006002c, 0x00000009, 0x00000044, 0x00000042, 0x00000043, 0x00000043, 0x00050036,
    0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x00000007,
    0x00000008, 0x00000007, 0x00050041, 0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c, 0x0004003d,
    0x00000006, 0x0000000f, 0x0000000e, 0x0003003e, 0x00000008, 0x0000000f, 0x0004003d, 0x00000006,
    0x00000010, 0x00000008, 0x00050041, 0x00000016, 0x00000017, 0x00000013, 0x00000015, 0x0004003d,
    0x00000006, 0x00000018, 0x00000017, 0x000500ae, 0x00000019, 0x0000001a, 0x00000010, 0x00000018,
    0x000300f7, 0x0000001c, 0x00000000, 0x000400fa, 0x0000001a, 0x0000001b, 0x0000001c, 0x000200f8,
    0x0000001b, 0x000100fd, 0x000200f8, 0x0000001c, 0x0004003d, 0x00000006, 0x00000024, 0x00000008,
    0x0004003d, 0x00000006, 0x0000002d, 0x00000008, 0x00060041, 0x0000002e, 0x0000002f, 0x0000002c,
    0x00000015, 0x0000002d, 0x0004003d, 0x00000006, 0x00000030, 0x0000002f, 0x00040053, 0x00000006,
    0x00000031, 0x00000030, 0x00050041, 0x00000032, 0x00000033, 0x00000028, 0x00000031, 0x0004003d,
    0x00000025, 0x00000034, 0x00000033, 0x0004003d, 0x00000035, 0x00000038, 0x00000037, 0x00050056,
    0x00000039, 0x0000003a, 0x00000034, 0x00000038, 0x00070058, 0x0000001f, 0x0000003f, 0x0000003a,
    0x0000003d, 0x00000002, 0x0000003e, 0x00060041, 0x00000040, 0x00000041, 0x00000023, 0x00000015,
    0x00000024, 0x0003003e, 0x00000041, 0x0000003f, 0x000100fd, 0x00010038,
]

pub let table_comp_msl: c.str = "#pragma clang diagnostic ignored \"-Wmissing-prototypes\"\n\n#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\ntemplate<typename T>\nstruct spvDescriptor\n{\n    T value;\n};\n\ntemplate<typename T>\nstruct spvDescriptorArray\n{\n    spvDescriptorArray(const device spvDescriptor<T>* ptr_) : ptr(&ptr_->value) {}\n    spvDescriptorArray(const device void *ptr_) : spvDescriptorArray(static_cast<const device spvDescriptor<T>*>(ptr_)) {}\n    const device T& operator [] (size_t i) const { return ptr[i]; }\n    const device T* ptr;\n};\n\nstruct Params\n{\n    uint n;\n};\n\nstruct Colors\n{\n    float4 colors[1];\n};\n\nstruct Materials\n{\n    uint slots[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nstruct spvDescriptorSetBuffer1\n{\n    spvDescriptor<texture2d<float>> textures [[id(0)]][1] /* unsized array hack */;\n};\n\nkernel void luce_compute(device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(29)]], device Materials& _44 [[buffer(0)]], device Colors& _35 [[buffer(1)]], constant Params& params [[buffer(30)]], sampler point [[sampler(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    spvDescriptorArray<texture2d<float>> textures {spvDescriptorSet1.textures};\n\n    uint i = gl_GlobalInvocationID.x;\n    if (i >= params.n)\n    {\n        return;\n    }\n    uint _49 = _44.slots[i];\n    _35.colors[i] = textures[_49].sample(point, float2(0.5), level(0.0));\n}\n\n"
pub let table_comp_group: u32[3] = [64, 1, 1]
pub let table_comp_bindings: u8[16] = [1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let table_comp_fast_math: bool = false
pub let table_comp_table: bool = true

# mark: rays: compute kernel ==================================================================

pub let rays_comp_words: u32[877] = [
    0x07230203, 0x00010500, 0x0008000b, 0x00000086, 0x00000000, 0x00020011, 0x00000001, 0x00020011,
    0x00001178, 0x0006000a, 0x5f565053, 0x5f52484b, 0x5f796172, 0x72657571, 0x00000079, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x000c000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000013, 0x00000025,
    0x00000040, 0x00000043, 0x00000063, 0x00000070, 0x00060010, 0x00000004, 0x00000011, 0x00000040,
    0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001cc, 0x00060004, 0x455f4c47, 0x725f5458,
    0x715f7961, 0x79726575, 0x00000000, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005,
    0x00000008, 0x00000069, 0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f,
    0x496e6f69, 0x00000044, 0x00040005, 0x00000011, 0x61726150, 0x0000736d, 0x00040006, 0x00000011,
    0x00000000, 0x0000006e, 0x00050006, 0x00000011, 0x00000001, 0x64616873, 0x0000776f, 0x00050006,
    0x00000011, 0x00000002, 0x6b73616d, 0x00000000, 0x00040005, 0x00000013, 0x61726170, 0x0000736d,
    0x00040005, 0x00000021, 0x6d6f7266, 0x00000000, 0x00040005, 0x00000023, 0x73796152, 0x00000000,
    0x00050006, 0x00000023, 0x00000000, 0x73796172, 0x00000000, 0x00030005, 0x00000025, 0x00000000,
    0x00050005, 0x0000002e, 0x65726964, 0x6f697463, 0x0000006e, 0x00040005, 0x00000036, 0x67616c66,
    0x00000073, 0x00040005, 0x00000040, 0x72657571, 0x00000079, 0x00040005, 0x00000043, 0x6e656373,
    0x00000065, 0x00030005, 0x0000005e, 0x00007675, 0x00040005, 0x00000061, 0x73746948, 0x00000000,
    0x00050006, 0x00000061, 0x00000000, 0x73746968, 0x00000000, 0x00030005, 0x00000063, 0x00000000,
    0x00030005, 0x0000006e, 0x00736449, 0x00040006, 0x0000006e, 0x00000000, 0x00736469, 0x00030005,
    0x00000070, 0x00000000, 0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00030047, 0x00000011,
    0x00000002, 0x00050048, 0x00000011, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000011,
    0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x00000011, 0x00000002, 0x00000023, 0x00000008,
    0x00040047, 0x00000022, 0x00000006, 0x00000010, 0x00030047, 0x00000023, 0x00000002, 0x00040048,
    0x00000023, 0x00000000, 0x00000018, 0x00050048, 0x00000023, 0x00000000, 0x00000023, 0x00000000,
    0x00030047, 0x00000025, 0x00000018, 0x00040047, 0x00000025, 0x00000021, 0x00000001, 0x00040047,
    0x00000025, 0x00000022, 0x00000000, 0x00040047, 0x00000043, 0x00000021, 0x00000000, 0x00040047,
    0x00000043, 0x00000022, 0x00000000, 0x00040047, 0x00000060, 0x00000006, 0x00000010, 0x00030047,
    0x00000061, 0x00000002, 0x00040048, 0x00000061, 0x00000000, 0x00000019, 0x00050048, 0x00000061,
    0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000063, 0x00000019, 0x00040047, 0x00000063,
    0x00000021, 0x00000002, 0x00040047, 0x00000063, 0x00000022, 0x00000000, 0x00040047, 0x0000006d,
    0x00000006, 0x00000010, 0x00030047, 0x0000006e, 0x00000002, 0x00040048, 0x0000006e, 0x00000000,
    0x00000019, 0x00050048, 0x0000006e, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000070,
    0x00000019, 0x00040047, 0x00000070, 0x00000021, 0x00000003, 0x00040047, 0x00000070, 0x00000022,
    0x00000000, 0x00040047, 0x00000085, 0x0000000b, 0x00000019, 0x00020013, 0x00000002, 0x00030021,
    0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020, 0x00000007,
    0x00000007, 0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020, 0x0000000a,
    0x00000001, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b, 0x00000006,
    0x0000000c, 0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x0005001e, 0x00000011,
    0x00000006, 0x00000006, 0x00000006, 0x00040020, 0x00000012, 0x00000009, 0x00000011, 0x0004003b,
    0x00000012, 0x00000013, 0x00000009, 0x00040015, 0x00000014, 0x00000020, 0x00000001, 0x0004002b,
    0x00000014, 0x00000015, 0x00000000, 0x00040020, 0x00000016, 0x00000009, 0x00000006, 0x00020014,
    0x00000019, 0x00030016, 0x0000001e, 0x00000020, 0x00040017, 0x0000001f, 0x0000001e, 0x00000004,
    0x00040020, 0x00000020, 0x00000007, 0x0000001f, 0x0003001d, 0x00000022, 0x0000001f, 0x0003001e,
    0x00000023, 0x00000022, 0x00040020, 0x00000024, 0x0000000c, 0x00000023, 0x0004003b, 0x00000024,
    0x00000025, 0x0000000c, 0x0004002b, 0x00000006, 0x00000026, 0x00000002, 0x00040020, 0x00000029,
    0x0000000c, 0x0000001f, 0x00040017, 0x0000002c, 0x0000001e, 0x00000003, 0x00040020, 0x0000002d,
    0x00000007, 0x0000002c, 0x0004002b, 0x00000006, 0x00000031, 0x00000001, 0x0004002b, 0x00000014,
    0x00000037, 0x00000001, 0x0004002b, 0x00000006, 0x0000003b, 0x00000004, 0x00021178, 0x0000003e,
    0x00040020, 0x0000003f, 0x00000006, 0x0000003e, 0x0004003b, 0x0000003f, 0x00000040, 0x00000006,
    0x000214dd, 0x00000041, 0x00040020, 0x00000042, 0x00000000, 0x00000041, 0x0004003b, 0x00000042,
    0x00000043, 0x00000000, 0x0004002b, 0x00000014, 0x00000046, 0x00000002, 0x0004002b, 0x0000001e,
    0x0000004b, 0x00000000, 0x0004002b, 0x00000006, 0x0000004d, 0x00000003, 0x00040020, 0x0000004e,
    0x00000007, 0x0000001e, 0x00030029, 0x00000019, 0x00000057, 0x00040017, 0x0000005c, 0x0000001e,
    0x00000002, 0x00040020, 0x0000005d, 0x00000007, 0x0000005c, 0x0003001d, 0x00000060, 0x0000001f,
    0x0003001e, 0x00000061, 0x00000060, 0x00040020, 0x00000062, 0x0000000c, 0x00000061, 0x0004003b,
    0x00000062, 0x00000063, 0x0000000c, 0x0004002b, 0x0000001e, 0x00000067, 0x3f800000, 0x00040017,
    0x0000006c, 0x00000006, 0x00000004, 0x0003001d, 0x0000006d, 0x0000006c, 0x0003001e, 0x0000006e,
    0x0000006d, 0x00040020, 0x0000006f, 0x0000000c, 0x0000006e, 0x0004003b, 0x0000006f, 0x00000070,
    0x0000000c, 0x00040020, 0x00000079, 0x0000000c, 0x0000006c, 0x0004002b, 0x0000001e, 0x0000007d,
    0xbf800000, 0x0007002c, 0x0000001f, 0x0000007e, 0x0000007d, 0x0000004b, 0x0000004b, 0x0000004b,
    0x0004002b, 0x00000006, 0x00000081, 0xffffffff, 0x0007002c, 0x0000006c, 0x00000082, 0x00000081,
    0x00000081, 0x00000081, 0x00000081, 0x0004002b, 0x00000006, 0x00000084, 0x00000040, 0x0006002c,
    0x00000009, 0x00000085, 0x00000084, 0x00000031, 0x00000031, 0x00050036, 0x00000002, 0x00000004,
    0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x00000007, 0x00000008, 0x00000007,
    0x0004003b, 0x00000020, 0x00000021, 0x00000007, 0x0004003b, 0x0000002d, 0x0000002e, 0x00000007,
    0x0004003b, 0x00000007, 0x00000036, 0x00000007, 0x0004003b, 0x0000005d, 0x0000005e, 0x00000007,
    0x00050041, 0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c, 0x0004003d, 0x00000006, 0x0000000f,
    0x0000000e, 0x0003003e, 0x00000008, 0x0000000f, 0x0004003d, 0x00000006, 0x00000010, 0x00000008,
    0x00050041, 0x00000016, 0x00000017, 0x00000013, 0x00000015, 0x0004003d, 0x00000006, 0x00000018,
    0x00000017, 0x000500ae, 0x00000019, 0x0000001a, 0x00000010, 0x00000018, 0x000300f7, 0x0000001c,
    0x00000000, 0x000400fa, 0x0000001a, 0x0000001b, 0x0000001c, 0x000200f8, 0x0000001b, 0x000100fd,
    0x000200f8, 0x0000001c, 0x0004003d, 0x00000006, 0x00000027, 0x00000008, 0x00050084, 0x00000006,
    0x00000028, 0x00000026, 0x00000027, 0x00060041, 0x00000029, 0x0000002a, 0x00000025, 0x00000015,
    0x00000028, 0x0004003d, 0x0000001f, 0x0000002b, 0x0000002a, 0x0003003e, 0x00000021, 0x0000002b,
    0x0004003d, 0x00000006, 0x0000002f, 0x00000008, 0x00050084, 0x00000006, 0x00000030, 0x00000026,
    0x0000002f, 0x00050080, 0x00000006, 0x00000032, 0x00000030, 0x00000031, 0x00060041, 0x00000029,
    0x00000033, 0x00000025, 0x00000015, 0x00000032, 0x0004003d, 0x0000001f, 0x00000034, 0x00000033,
    0x0008004f, 0x0000002c, 0x00000035, 0x00000034, 0x00000034, 0x00000000, 0x00000001, 0x00000002,
    0x0003003e, 0x0000002e, 0x00000035, 0x00050041, 0x00000016, 0x00000038, 0x00000013, 0x00000037,
    0x0004003d, 0x00000006, 0x00000039, 0x00000038, 0x000500ab, 0x00000019, 0x0000003a, 0x00000039,
    0x0000000c, 0x000600a9, 0x00000006, 0x0000003c, 0x0000003a, 0x0000003b, 0x0000000c, 0x000500c5,
    0x00000006, 0x0000003d, 0x00000031, 0x0000003c, 0x0003003e, 0x00000036, 0x0000003d, 0x0004003d,
    0x00000041, 0x00000044, 0x00000043, 0x0004003d, 0x00000006, 0x00000045, 0x00000036, 0x00050041,
    0x00000016, 0x00000047, 0x00000013, 0x00000046, 0x0004003d, 0x00000006, 0x00000048, 0x00000047,
    0x0004003d, 0x0000001f, 0x00000049, 0x00000021, 0x0008004f, 0x0000002c, 0x0000004a, 0x00000049,
    0x00000049, 0x00000000, 0x00000001, 0x00000002, 0x0004003d, 0x0000002c, 0x0000004c, 0x0000002e,
    0x00050041, 0x0000004e, 0x0000004f, 0x00000021, 0x0000004d, 0x0004003d, 0x0000001e, 0x00000050,
    0x0000004f, 0x00091179, 0x00000040, 0x00000044, 0x00000045, 0x00000048, 0x0000004a, 0x0000004b,
    0x0000004c, 0x00000050, 0x000200f9, 0x00000051, 0x000200f8, 0x00000051, 0x000400f6, 0x00000053,
    0x00000054, 0x00000000, 0x000200f9, 0x00000055, 0x000200f8, 0x00000055, 0x0004117d, 0x00000019,
    0x00000056, 0x00000040, 0x000400fa, 0x00000056, 0x00000052, 0x00000053, 0x000200f8, 0x00000052,
    0x000200f9, 0x00000054, 0x000200f8, 0x00000054, 0x000200f9, 0x00000051, 0x000200f8, 0x00000053,
    0x0005117f, 0x00000006, 0x00000058, 0x00000040, 0x00000037, 0x000500aa, 0x00000019, 0x00000059,
    0x00000058, 0x00000031, 0x000300f7, 0x0000005b, 0x00000000, 0x000400fa, 0x00000059, 0x0000005a,
    0x0000007b, 0x000200f8, 0x0000005a, 0x00051788, 0x0000005c, 0x0000005f, 0x00000040, 0x00000037,
    0x0003003e, 0x0000005e, 0x0000005f, 0x0004003d, 0x00000006, 0x00000064, 0x00000008, 0x00051782,
    0x0000001e, 0x00000065, 0x00000040, 0x00000037, 0x0004003d, 0x0000005c, 0x00000066, 0x0000005e,
    0x00050051, 0x0000001e, 0x00000068, 0x00000066, 0x00000000, 0x00050051, 0x0000001e, 0x00000069,
    0x00000066, 0x00000001, 0x00070050, 0x0000001f, 0x0000006a, 0x00000065, 0x00000068, 0x00000069,
    0x00000067, 0x00060041, 0x00000029, 0x0000006b, 0x00000063, 0x00000015, 0x00000064, 0x0003003e,
    0x0000006b, 0x0000006a, 0x0004003d, 0x00000006, 0x00000071, 0x00000008, 0x00051787, 0x00000014,
    0x00000072, 0x00000040, 0x00000037, 0x0004007c, 0x00000006, 0x00000073, 0x00000072, 0x00051783,
    0x00000014, 0x00000074, 0x00000040, 0x00000037, 0x0004007c, 0x00000006, 0x00000075, 0x00000074,
    0x00051784, 0x00000014, 0x00000076, 0x00000040, 0x00000037, 0x0004007c, 0x00000006, 0x00000077,
    0x00000076, 0x00070050, 0x0000006c, 0x00000078, 0x00000073, 0x00000075, 0x00000077, 0x0000000c,
    0x00060041, 0x00000079, 0x0000007a, 0x00000070, 0x00000015, 0x00000071, 0x0003003e, 0x0000007a,
    0x00000078, 0x000200f9, 0x0000005b, 0x000200f8, 0x0000007b, 0x0004003d, 0x00000006, 0x0000007c,
    0x00000008, 0x00060041, 0x00000029, 0x0000007f, 0x00000063, 0x00000015, 0x0000007c, 0x0003003e,
    0x0000007f, 0x0000007e, 0x0004003d, 0x00000006, 0x00000080, 0x00000008, 0x00060041, 0x00000079,
    0x00000083, 0x00000070, 0x00000015, 0x00000080, 0x0003003e, 0x00000083, 0x00000082, 0x000200f9,
    0x0000005b, 0x000200f8, 0x0000005b, 0x000100fd, 0x00010038,
]

pub let rays_comp_msl: c.str = "#pragma clang diagnostic ignored \"-Wmissing-prototypes\"\n\n#include <metal_stdlib>\n#include <simd/simd.h>\n#if __METAL_VERSION__ >= 230\n#include <metal_raytracing>\nusing namespace metal::raytracing;\n#endif\n\nusing namespace metal;\n\nintersection_params spvMakeIntersectionParams(uint flags)\n{\n    intersection_params ip;\n    if ((flags & 1) != 0)\n        ip.force_opacity(forced_opacity::opaque);\n    if ((flags & 2) != 0)\n        ip.force_opacity(forced_opacity::non_opaque);\n    if ((flags & 4) != 0)\n        ip.accept_any_intersection(true);\n    if ((flags & 16) != 0)\n        ip.set_triangle_cull_mode(triangle_cull_mode::back);\n    if ((flags & 32) != 0)\n        ip.set_triangle_cull_mode(triangle_cull_mode::front);\n    if ((flags & 64) != 0)\n        ip.set_opacity_cull_mode(opacity_cull_mode::opaque);\n    if ((flags & 128) != 0)\n        ip.set_opacity_cull_mode(opacity_cull_mode::non_opaque);\n    if ((flags & 256) != 0)\n        ip.set_geometry_cull_mode(geometry_cull_mode::triangle);\n    if ((flags & 512) != 0)\n        ip.set_geometry_cull_mode(geometry_cull_mode::bounding_box);\n    return ip;\n}\n\nstruct Params\n{\n    uint n;\n    uint shadow;\n    uint mask;\n};\n\nstruct Rays\n{\n    float4 rays[1];\n};\n\nstruct Hits\n{\n    float4 hits[1];\n};\n\nstruct Ids\n{\n    uint4 ids[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(constant Params& params [[buffer(30)]], device Rays& _37 [[buffer(1)]], device Hits& _99 [[buffer(2)]], device Ids& _112 [[buffer(3)]], raytracing::acceleration_structure<raytracing::instancing> scene [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    raytracing::intersection_query<raytracing::instancing, raytracing::triangle_data> query;\n    if (i >= params.n)\n    {\n        return;\n    }\n    float4 from = _37.rays[2u * i];\n    float3 direction = _37.rays[(2u * i) + 1u].xyz;\n    uint flags = 1u | ((params.shadow != 0u) ? 4u : 0u);\n    query.reset(ray(from.xyz, direction, 0.0, from.w), scene, params.mask, spvMakeIntersectionParams(flags));\n    for (;;)\n    {\n        bool _86 = query.next();\n        if (_86)\n        {\n            continue;\n        }\n        else\n        {\n            break;\n        }\n    }\n    uint _88 = uint(query.get_committed_intersection_type());\n    if (_88 == 1u)\n    {\n        float2 _95 = query.get_committed_triangle_barycentric_coord();\n        float2 uv = _95;\n        float _101 = query.get_committed_distance();\n        _99.hits[i] = float4(_101, uv, 1.0);\n        int _114 = query.get_committed_primitive_id();\n        int _116 = query.get_committed_user_instance_id();\n        int _118 = query.get_committed_instance_id();\n        _112.ids[i] = uint4(uint(_114), uint(_116), uint(_118), 0u);\n    }\n    else\n    {\n        _99.hits[i] = float4(-1.0, 0.0, 0.0, 0.0);\n        _112.ids[i] = uint4(4294967295u);\n    }\n}\n\n"
pub let rays_comp_group: u32[3] = [64, 1, 1]
pub let rays_comp_bindings: u8[16] = [4, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let rays_comp_fast_math: bool = false
pub let rays_comp_table: bool = false

# mark: special: compute kernel ===============================================================

pub let special_comp_words: u32[422] = [
    0x07230203, 0x00010500, 0x0008000b, 0x0000003f, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
    0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
    0x0008000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000b, 0x00000013, 0x00000038,
    0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001, 0x00030003, 0x00000002,
    0x000001c2, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00030005, 0x00000008, 0x00000069,
    0x00080005, 0x0000000b, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044,
    0x00040005, 0x00000011, 0x61726150, 0x0000736d, 0x00040006, 0x00000011, 0x00000000, 0x0000006e,
    0x00040005, 0x00000013, 0x61726170, 0x0000736d, 0x00030005, 0x00000020, 0x00000078, 0x00040005,
    0x00000023, 0x4c414353, 0x00000045, 0x00040005, 0x00000025, 0x5346464f, 0x00005445, 0x00040005,
    0x00000028, 0x45444f4d, 0x00000000, 0x00040005, 0x0000002f, 0x50494c46, 0x00000000, 0x00040005,
    0x00000036, 0x756c6156, 0x00007365, 0x00050006, 0x00000036, 0x00000000, 0x756c6176, 0x00007365,
    0x00030005, 0x00000038, 0x00000000, 0x00040047, 0x0000000b, 0x0000000b, 0x0000001c, 0x00030047,
    0x00000011, 0x00000002, 0x00050048, 0x00000011, 0x00000000, 0x00000023, 0x00000000, 0x00040047,
    0x00000023, 0x00000001, 0x00000002, 0x00040047, 0x00000025, 0x00000001, 0x00000001, 0x00040047,
    0x00000028, 0x00000001, 0x00000000, 0x00040047, 0x0000002f, 0x00000001, 0x00000005, 0x00040047,
    0x00000035, 0x00000006, 0x00000004, 0x00030047, 0x00000036, 0x00000002, 0x00040048, 0x00000036,
    0x00000000, 0x00000019, 0x00050048, 0x00000036, 0x00000000, 0x00000023, 0x00000000, 0x00030047,
    0x00000038, 0x00000019, 0x00040047, 0x00000038, 0x00000021, 0x00000000, 0x00040047, 0x00000038,
    0x00000022, 0x00000000, 0x00040047, 0x0000003e, 0x0000000b, 0x00000019, 0x00020013, 0x00000002,
    0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020,
    0x00000007, 0x00000007, 0x00000006, 0x00040017, 0x00000009, 0x00000006, 0x00000003, 0x00040020,
    0x0000000a, 0x00000001, 0x00000009, 0x0004003b, 0x0000000a, 0x0000000b, 0x00000001, 0x0004002b,
    0x00000006, 0x0000000c, 0x00000000, 0x00040020, 0x0000000d, 0x00000001, 0x00000006, 0x0003001e,
    0x00000011, 0x00000006, 0x00040020, 0x00000012, 0x00000009, 0x00000011, 0x0004003b, 0x00000012,
    0x00000013, 0x00000009, 0x00040015, 0x00000014, 0x00000020, 0x00000001, 0x0004002b, 0x00000014,
    0x00000015, 0x00000000, 0x00040020, 0x00000016, 0x00000009, 0x00000006, 0x00020014, 0x00000019,
    0x00030016, 0x0000001e, 0x00000020, 0x00040020, 0x0000001f, 0x00000007, 0x0000001e, 0x00040032,
    0x0000001e, 0x00000023, 0x40000000, 0x00040032, 0x00000014, 0x00000025, 0xffffffff, 0x00040032,
    0x00000006, 0x00000028, 0x00000000, 0x0004002b, 0x00000006, 0x00000029, 0x00000001, 0x00060034,
    0x00000019, 0x0000002a, 0x000000aa, 0x00000028, 0x00000029, 0x00030031, 0x00000019, 0x0000002f,
    0x0004002b, 0x0000001e, 0x00000033, 0x41200000, 0x0003001d, 0x00000035, 0x0000001e, 0x0003001e,
    0x00000036, 0x00000035, 0x00040020, 0x00000037, 0x0000000c, 0x00000036, 0x0004003b, 0x00000037,
    0x00000038, 0x0000000c, 0x00040020, 0x0000003b, 0x0000000c, 0x0000001e, 0x0004002b, 0x00000006,
    0x0000003d, 0x00000040, 0x0006002c, 0x00000009, 0x0000003e, 0x0000003d, 0x00000029, 0x00000029,
    0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b,
    0x00000007, 0x00000008, 0x00000007, 0x0004003b, 0x0000001f, 0x00000020, 0x00000007, 0x00050041,
    0x0000000d, 0x0000000e, 0x0000000b, 0x0000000c, 0x0004003d, 0x00000006, 0x0000000f, 0x0000000e,
    0x0003003e, 0x00000008, 0x0000000f, 0x0004003d, 0x00000006, 0x00000010, 0x00000008, 0x00050041,
    0x00000016, 0x00000017, 0x00000013, 0x00000015, 0x0004003d, 0x00000006, 0x00000018, 0x00000017,
    0x000500ae, 0x00000019, 0x0000001a, 0x00000010, 0x00000018, 0x000300f7, 0x0000001c, 0x00000000,
    0x000400fa, 0x0000001a, 0x0000001b, 0x0000001c, 0x000200f8, 0x0000001b, 0x000100fd, 0x000200f8,
    0x0000001c, 0x0004003d, 0x00000006, 0x00000021, 0x00000008, 0x00040070, 0x0000001e, 0x00000022,
    0x00000021, 0x00050085, 0x0000001e, 0x00000024, 0x00000022, 0x00000023, 0x0004006f, 0x0000001e,
    0x00000026, 0x00000025, 0x00050081, 0x0000001e, 0x00000027, 0x00000024, 0x00000026, 0x0003003e,
    0x00000020, 0x00000027, 0x000300f7, 0x0000002c, 0x00000000, 0x000400fa, 0x0000002a, 0x0000002b,
    0x0000002c, 0x000200f8, 0x0000002b, 0x0004003d, 0x0000001e, 0x0000002d, 0x00000020, 0x0004007f,
    0x0000001e, 0x0000002e, 0x0000002d, 0x0003003e, 0x00000020, 0x0000002e, 0x000200f9, 0x0000002c,
    0x000200f8, 0x0000002c, 0x000300f7, 0x00000031, 0x00000000, 0x000400fa, 0x0000002f, 0x00000030,
    0x00000031, 0x000200f8, 0x00000030, 0x0004003d, 0x0000001e, 0x00000032, 0x00000020, 0x00050085,
    0x0000001e, 0x00000034, 0x00000032, 0x00000033, 0x0003003e, 0x00000020, 0x00000034, 0x000200f9,
    0x00000031, 0x000200f8, 0x00000031, 0x0004003d, 0x00000006, 0x00000039, 0x00000008, 0x0004003d,
    0x0000001e, 0x0000003a, 0x00000020, 0x00060041, 0x0000003b, 0x0000003c, 0x00000038, 0x00000015,
    0x00000039, 0x0003003e, 0x0000003c, 0x0000003a, 0x000100fd, 0x00010038,
]

pub let special_comp_msl: c.str = "#include <metal_stdlib>\n#include <simd/simd.h>\n\nusing namespace metal;\n\nstruct Params\n{\n    uint n;\n};\n\nconstant float SCALE_tmp [[function_constant(2)]];\nconstant float SCALE = is_function_constant_defined(SCALE_tmp) ? SCALE_tmp : 2.0;\nconstant int OFFSET_tmp [[function_constant(1)]];\nconstant int OFFSET = is_function_constant_defined(OFFSET_tmp) ? OFFSET_tmp : -1;\nconstant uint MODE_tmp [[function_constant(0)]];\nconstant uint MODE = is_function_constant_defined(MODE_tmp) ? MODE_tmp : 0u;\nconstant bool _42 = (MODE == 1u);\nconstant bool FLIP_tmp [[function_constant(5)]];\nconstant bool FLIP = is_function_constant_defined(FLIP_tmp) ? FLIP_tmp : false;\n\nstruct Values\n{\n    float values[1];\n};\n\nconstant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u);\n\nkernel void luce_compute(constant Params& params [[buffer(30)]], device Values& _56 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])\n{\n    uint i = gl_GlobalInvocationID.x;\n    if (i >= params.n)\n    {\n        return;\n    }\n    float x = (float(i) * SCALE) + float(OFFSET);\n    if (_42)\n    {\n        x = -x;\n    }\n    if (FLIP)\n    {\n        x *= 10.0;\n    }\n    _56.values[i] = x;\n}\n\n"
pub let special_comp_group: u32[3] = [64, 1, 1]
pub let special_comp_bindings: u8[16] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pub let special_comp_fast_math: bool = false
pub let special_comp_table: bool = false
pub let special_comp_constant_ids: u32[4] = [0, 1, 2, 5]
pub let special_comp_constant_kinds: u8[4] = [1, 2, 3, 4]
pub let special_comp_constant_defaults: u32[4] = [0x00000000, 0xffffffff, 0x40000000, 0x00000000]
pub let special_comp_constant_names: c.str[4] = ["MODE", "OFFSET", "SCALE", "FLIP"]