Week 8 test guide

A test failed and you don't know why? Find it here: what it checks, and the plausible bugs that are known to fail it. Then read the matching part of the week 8 spec.

How to use this

Run python tools/test.py --compiler PATH --week 8 -v, copy the failing test's name, and search below. "Bugs known to fail it" lists mistakes that were planted in the reference compiler and caught by this test, so one of them is a good first guess. It's not a complete list, and the debugging guide covers what to do when none fit.

testkindwhat it checksbugs known to fail it
render/c_block_shared_freshcudashared memory starts at zero in every block, so the kernel must zero itrender private allocs shared
render/c_err_alloc_in_two_kernelscuda: invalidan alloc used by two global loops isn't any one block's shared memory, so it has nowhere to live on the GPUnone recorded
render/c_err_kernel_uses_outer_loopcuda: invalida global loop inside a plain loop uses the plain loop's index, which only the CPU knowsnone recorded
render/c_err_thread_loopcuda: invalida week 7 thread loop runs on CPU threads: render-cuda wants global and local loopsnone recorded
render/c_err_work_outside_kernelcuda: invalida load at the top level would run on the CPU: render-cuda needs every bit of work inside a kernelnone recorded
render/c_gemm_row_stripscudaa GEMM with one block per strip of rows, looping over column tiles insiderender private allocs shared
render/c_gemm_tile_per_blockcudathe textbook GEMM: a block per 4x4 tile of C, shared A and B tiles, one accumulator per threadrender private allocs shared
render/c_reverse_sharedcudatwo phases through shared memory: without __syncthreads between them, threads read before others writecuda no barrier between phases
render private allocs shared
render/c_reverse_shared_1024cudathe reversal with 1024-thread blocks: on a real GPU, 32 warps make a missing __syncthreads showcuda no barrier between phases
render/c_scalecudaone thread per element: blockIdx and threadIdxnone recorded
render/c_shared_dirty_then_freshcudakernel 1 fills shared memory with 7s. Kernel 2 must still see its own shared memory start at zero, so the kernel has to zero itcuda shared memory not zeroed
render/c_tiles_2d_layoutcudaa 2D grid of blocks, written through div and modnone recorded
render/c_two_kernelscudatwo kernels in a row: the second reads what the first wrotenone recorded
render/c_zero_blockscudaa grid of zero blocks: nothing runs, nothing breaksnone recorded
render/r_gemm_tile_per_block_cpurenderthe same GPU program rendered for the CPU: global as threads, local as loopsrender private allocs shared
render/r_reverse_shared_cpurenderphases on the CPU are just consecutive loopsnone recorded
render/s_cuda_gemm_512cuda, speed 0.5a 512x512 GEMM on the GPU: at least half the reference kernel's speed. Without a GPU it only has to build.cuda local loops run in one thread
cuda no barrier between phases
cuda shared memory not zeroed
render private allocs shared
run/block_shared_starts_at_zerorun: passshared memory used only in one global loop starts at zero in every block: o = b + tnone recorded
run/digits_just_apartrun: passo[3b + t] with t up to 2 is fine: 3 is more than 2none recorded
run/err_block_layouts_differrun: invalidone buffer written with two different block layoutsblock layouts may differ
run/err_blocks_write_one_placerun: invalidthe block index is missing from the offset: every block writes o[t]parallel index may be missing
run/err_coefficient_not_literalrun: invalidblock offsets use literal coefficientsnone recorded
run/err_digits_exactly_touchrun: invalido[2b + t] with t up to 2: block 1 thread 0 and block 0 thread 2 both write o[2]. The coefficient 2 must be more than 2, not equal.digits may touch
run/err_local_nestedrun: invalida local loop inside another local loopnone recorded
run/err_local_not_literalrun: invalidthe block size is a literalnone recorded
run/err_local_outside_globalrun: invalida local loop runs inside a block, so it needs a global loop around itlocal outside global allowed
run/err_local_sizes_differrun: invalidall local loops in one kernel are the same block: one sizeblock sizes may differ
run/err_local_too_bigrun: invalida block has at most 1024 threadsnone recorded
run/err_same_phase_neighborrun: invalidreading sh[t + 1] in the same phase that writes sh: thread t + 1 may not have written it yetphase loads unchecked
run/err_store_outside_localrun: invalida store in a block but outside any local loop would run on every thread of the blockstore outside local allowed
run/err_thread_in_globalrun: invalidCPU threads inside a GPU blocknone recorded
run/err_threads_write_one_cellrun: invalidevery thread of the block writes sh[0]: a raceparallel index may be missing
run/err_tiles_2d_overlaprun: invalidby*4 + bx*2 + ty*2 + tx: bx and ty share a coefficient, so blocks overlapnone recorded
run/global_local_same_resultrun: passtwo blocks of four threads compute exactly what plain loops donone recorded
run/global_local_wrong_valuerun: assert_failand a wrong value still failsnone recorded
run/later_phase_reads_anywhererun: passa later phase may read any shared element an earlier phase wrote: reverse each block of 4none recorded
run/local_bound_1024run: pass1024 threads is allowednone recorded
run/plain_loop_alloc_carries_overrun: passthe same program as plain loops carries the alloc from b = 0 into b = 1none recorded
run/tiles_2d_layoutrun: passa 4x4 matrix as 2x2 blocks of 2x2 threads: by*8 + bx*2 + ty*4 + tx, a unique mixed-radix numbernone recorded