Week 5 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 5 spec.

How to use this

Run python tools/test.py --compiler PATH --week 5 -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/gemm_movement_3x4x5renderthe spec's GEMM: reshape, permute, expand, mul, reduce pop=1render expand reads i
render flat_of order
render unflat stride
render/pad_2drenderpad a 2x3 with a ring of zeros: 4x5render flat_of order
render pad mask off by one
render unflat stride
render/r_column_normalizerenderdivide each column by its sum: reduce, reshape, expand, mulrender flat_of order
render unflat stride
render/r_conv1d_samerendersame-size conv1d with a 5-tap kernelrender expand reads i
render pad mask off by one
render shrink offset sign
render stack chain off by one
render/r_conv2d_16x16render3x3 same-size conv2d on 16x16render expand reads i
render pad mask off by one
render shrink offset sign
render stack chain off by one
render/r_elementwise_rank3renderelementwise mul and max on rank 3none recorded
render/r_expand_scalarrenderbroadcast a scalar to a matrixnone recorded
render/r_expand_size1renderbroadcast a columnnone recorded
render/r_matmul_1x8x5rendera row vector times a matrixnone recorded
render/r_matmul_2x3x4rendermatmul via movement opsnone recorded
render/r_matmul_64x64render64x64 by 64x64: three nested loops in C, well under 20 KBnone recorded
render/r_matmul_i32_wraprenderi32 matmul with wraparoundnone recorded
render/r_pad_32x32renderpad a 32x32 image by one: 34x34none recorded
render/r_pad_3drenderpad a rank-3 valuerender pad shift wrong side
render/r_pad_boolrenderbool pad fills falserender pad shift wrong side
render/r_pad_left_rightrenderpad both sides of a vectorrender pad shift wrong side
render/r_pad_then_shrinkrenderpad then an off-center window: some zeros, some datarender shrink offset sign
render/r_permute_rank3rendera rank-3 permuterender permute inverse
render/r_permute_rank4rendera rank-4 permuterender permute inverse
render/r_reduce_pop1rendercolumn sums of a matrixnone recorded
render/r_reduce_pop2_64x64rendersum of a 64x64 matrix in row-major orderrender reduce column-major
render/r_reduce_pop2_rank3renderreduce the two leading axes of a rank-3 valuenone recorded
render/r_reduce_rowmajor_orderrenderrow-major fold order is visible in f32 bitsrender reduce column-major
render/r_reshape_permute_2drendertranspose via permute, stored flatnone recorded
render/r_reshape_permute_4096render4096 elements reshaped to 16x16x16 and reversed axis ordernone recorded
render/r_reshape_same_rank_then_transposerenderreshape [2 3] to [3 2] is not a no-op: transposing afterwards shows the new row boundariesrender reshape same rank skipped
render/r_shrink_symbolicrendera run-time but provable offset: mod (max o 0) 4 with o = 13 is 1none recorded
render/r_shrink_windowrendera value windownone recorded
render/r_stack_indexrenderindex a stack of vectorsrender index pops the end
render/r_stack_matricesrenderstack of matrices rendered as a where chainrender stack chain off by one
render/r_stage_rank2renderstage a transposed matrix, then use it twicenone recorded
render/r_transpose_64x64render64x64 transpose: loops, not 4096 unrolled storesnone recorded
run/assert_rank2_failsrun: assert_failassert compares every element of a rank-2 valuenone recorded
run/broadcast_column_sums_backrun: passreduce over rows, reshape to [1 4], expand back, add: the normalization shapeexpand reads i not 0
reduce pops trailing axes
reshape column-major
run/conv1d_samerun: passsame-size conv1d: pad, a stack of shifted shrinks, multiply by the broadcast kernel, reduce over tapsexpand reads i not 0
pad fill not zero
reduce pops trailing axes
shrink offset sign
run/conv2d_samerun: pass3x3 same-size conv2d on a 4x5 image via pad and nine shrinksexpand reads i not 0
pad fill not zero
reduce pops trailing axes
reshape column-major
shrink offset sign
run/elementwise_rank3run: passadd, mul, cmplt, where and cast work elementwise on rank-3 valuesnone recorded
run/err_expand_non1_axisrun: invalida size-2 axis cannot grow to 4expand grows non-1 axes
run/err_expand_rank_mismatchrun: invalida non-scalar expand keeps the ranknone recorded
run/err_index_runtime_oobrun: invalida computed index past the end is a run-time errornone recorded
run/err_index_too_manyrun: invalidat most one index per axisindex count unchecked
run/err_pad_lengthrun: invalidpads has two numbers per axispads length unchecked
run/err_pad_negativerun: invalidpads are >= 0 (cut with shrink)none recorded
run/err_param_rank2run: invalidparams stay rank 0 or 1none recorded
run/err_permute_duplicaterun: invalidorder must be a permutationpermute any order
run/err_permute_out_of_rangerun: invalidorder must name each axis oncepermute any order
run/err_permute_wrong_lengthrun: invalidorder has one entry per axisnone recorded
run/err_reduce_pop_too_bigrun: invalidpop can drop at most every axisnone recorded
run/err_reshape_countrun: invalidreshape must keep the element countreshape count unchecked
run/err_reshape_zero_dimrun: invalidshape sizes are positivenone recorded
run/err_shrink_offset_countrun: invalidone offset per axisshrink offset count unchecked
run/err_shrink_past_endrun: invalidoffset 3 plus 2 elements passes the end of 4shrink bounds unchecked
run/err_shrink_unprovablerun: invalida raw loaded offset could be anythingshrink bounds unchecked
run/err_stack_mixed_shaperun: invalidstack operands share one shapestack shapes unchecked
run/expand_rank3_middlerun: passa middle size-1 axis broadcastsreshape column-major
run/expand_scalar_rank2run: passa scalar expands to any shapenone recorded
run/expand_size1_axesrun: passonly size-1 axes grow, and they repeat the single elementnone recorded
run/expand_then_reducerun: passbroadcast then reduce: every column gets the same column sumnone recorded
run/gemm_movement_valuerun: passC[2][4] computed independently with per-op f32 roundingnone recorded
run/matmul_movement_1x5x3run: pass(1x5) @ (5x3) with reshape, permute, expand, mul, reduce pop=1; sums over k in ordernone recorded
run/matmul_movement_2x3x2run: pass(2x3) @ (3x2) with reshape, permute, expand, mul, reduce pop=1; sums over k in ordernone recorded
run/matmul_movement_3x3x1run: pass(3x3) @ (3x1) with reshape, permute, expand, mul, reduce pop=1; sums over k in ordernone recorded
run/matmul_movement_4x1x2run: pass(4x1) @ (1x2) with reshape, permute, expand, mul, reduce pop=1; sums over k in ordernone recorded
run/matmul_syllabus_formrun: passthe syllabus GEMM: A stored transposed as K x M, reshape [K M 1], no permutenone recorded
run/pad_2d_mixedrun: passpad rows on top and columns on the right, f32 fill 0.0pad fill not zero
pad sides swapped
run/pad_3drun: passpads apply per axis, in axis orderpad sides swapped
run/pad_bool_falserun: passbool pads with falsepad sides swapped
run/pad_left_onlyrun: passpads=[2 0] adds two zeros on the leftnone recorded
run/pad_right_onlyrun: passpads=[0 3] adds three zeros on the rightnone recorded
run/pad_shrink_roundtrip_3drun: passshrinking a pad at its left pads recovers the valueshrink offset sign
run/pad_shrink_valuerun: passpad then shrink back recovers the original, and an off-center window sees the zerosnone recorded
run/pad_zerorun: passpads of zero change nothingnone recorded
run/permute_identityrun: passthe identity order changes nothingnone recorded
run/permute_inverse_roundtriprun: passorder [1 2 0] then its inverse [2 0 1] gives x backpermute inverse
run/permute_rank3_all_ordersrun: passall six axis orders of a [2 3 4] valuepermute inverse
run/permute_rank4run: passshape[k] = x.shape[order[k]]: [2 3 1 2] with order [3 1 0 2] is [2 3 2 1]permute inverse
run/permute_then_reshaperun: passreshape after a transpose reads the transposed (row-major) ordernone recorded
run/permute_transposerun: passpermute [2 3] with order [1 0] is the transposenone recorded
run/reduce_last_axis_via_permuterun: passto reduce the last axis, permute it to the front (row sums of x)none recorded
run/reduce_max_nan_mul_wraprun: passmax over rows propagates NaN per column, and i32 mul wraps (65536 * 65536 = 0)none recorded
run/reduce_pop1_pop2run: passpop=1 sums over rows (one total per column), and pop=2 sums everythingnone recorded
run/reduce_rank3_popsrun: passpop=1, 2, 3 on a rank-3 value, and pop defaults to 1none recorded
run/reduce_rowmajor_orderrun: passpop=2 folds x00, x01, x10, x11 in row-major order: 1e8+1 rounds to 1e8, so the total is 1, not 2reduce folds column-major
run/reshape_from_scalarrun: passa scalar reshapes to [1 1] and back downnone recorded
run/reshape_rank_downrun: passreshape a rank-3 value flat keeps row-major ordernone recorded
run/reshape_rank_uprun: passreshape [12] to [3 4] is row-major: element (2, 1) is 9none recorded
run/reshape_same_rankrun: passreshape [2 3] to [3 2] is not a transpose: same flat ordernone recorded
run/reshape_to_scalarrun: passreshape [1] to shape=[] gives a scalarnone recorded
run/shrink_constantrun: passa [2 3] window starting at (1, 2)none recorded
run/shrink_of_shrinkrun: passoffsets of nested shrinks add upnone recorded
run/shrink_symbolic_provablerun: passmod (max o 0) 2 is in [0, 1], so a 3-wide window of 4 is provably in range (o = 5 gives 1)none recorded
run/stack_matrices_runtime_indexrun: passstack of matrices is rank 3; a run-time index picks one rownone recorded
run/stack_vectors_and_indexrun: passstack of vectors is [3 4]; index pops leading axesnone recorded
run/stage_rank2run: passstage is the identity on a rank-2 valuenone recorded