Commit 0dd4aca
Add mojo format to pre-commit/CI and parallelize update_challenges.py (#239)
Wires mojo format into the lint pipeline and applies it repo-wide (78
starter files reformatted). Also parallelizes the HTTP uploads in
scripts/update_challenges.py so deploys fan out instead of running
serially.
- .pre-commit-config.yaml: local mojo-format hook running `mojo format -q`
- .github/workflows/lint.yml: lint-mojo job now installs `modular` via pip
and enforces formatting via `mojo format` + `git diff --exit-code`
- .github/workflows/create-challenge.yml: adds `modular` to the cron's pip
install so Claude's `pre-commit run --all-files` step has `mojo` on PATH
- pyproject.toml: drop `target-version = ['py312']` from [tool.black] —
mblack (which `mojo format` wraps) reads the same section and rejects
any target above py311; black auto-detects target fine without it
- scripts/update_challenges.py: upload via ThreadPoolExecutor(max_workers=16).
Loading stays sequential because importlib with a shared "challenge"
module name and sys.path mutation is not thread-safe.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9a9c134 commit 0dd4aca
83 files changed
Lines changed: 793 additions & 193 deletions
File tree
- .github/workflows
- challenges
- easy
- 19_reverse_array/starter
- 1_vector_add/starter
- 21_relu/starter
- 23_leaky_relu/starter
- 24_rainbow_table/starter
- 2_matrix_multiplication/starter
- 31_matrix_copy/starter
- 3_matrix_transpose/starter
- 52_silu/starter
- 54_swiglu/starter
- 62_value_clipping/starter
- 63_interleave/starter
- 65_geglu/starter
- 66_rgb_to_grayscale/starter
- 68_sigmoid/starter
- 7_color_inversion/starter
- 8_matrix_addition/starter
- 9_1d_convolution/starter
- hard
- 12_multi_head_attention/starter
- 14_multi_agent_sim/starter
- 15_sorting/starter
- 20_kmeans_clustering/starter
- 36_radix_sort/starter
- 39_Fast_Fourier_transform/starter
- 46_bfs_shortest_path/starter
- 53_casual_attention/starter
- 56_linear_attention/starter
- 59_sliding_window_attn/starter
- 73_all_pairs_shortest_paths/starter
- 74_gpt2_block/starter
- medium
- 10_2d_convolution/starter
- 11_3d_convolution/starter
- 13_histogramming/starter
- 16_prefix_sum/starter
- 17_dot_product/starter
- 18_sparse_matrix_vector_multiplication/starter
- 22_gemm/starter
- 25_categorical_cross_entropy_loss/starter
- 27_mean_squared_error/starter
- 28_gaussian_blur/starter
- 29_top_k_selection/starter
- 30_batched_matrix_multiplication/starter
- 32_int8_quantized_matmul/starter
- 33_ordinary_least_squares/starter
- 34_logistic_regression/starter
- 35_monte_carlo_integration/starter
- 37_matrix_power/starter
- 38_nearest_neighbor/starter
- 40_batch_normalization/starter
- 42_2d_max_pooling/starter
- 43_count_array_element/starter
- 44_count_2d_array_element/starter
- 45_count_3d_array_element/starter
- 47_subarray_sum/starter
- 48_2d_subarray_sum/starter
- 49_3d_subarray_sum/starter
- 4_reduction/starter
- 50_rms_normalization/starter
- 51_max_subarray_sum/starter
- 55_attn_w_linear_bias/starter
- 57_fp16_batched_matmul/starter
- 58_fp16_dot_product/starter
- 5_softmax/starter
- 60_top_p_sampling/starter
- 61_rope_embedding/starter
- 64_weight_dequantization/starter
- 67_moe_topk_gating/starter
- 69_jacobi_stencil_2d/starter
- 6_softmax_attention/starter
- 70_segmented_prefix_sum/starter
- 71_parallel_merge/starter
- 72_stream_compaction/starter
- 75_sparse_matrix_dense_matrix_multiplication/starter
- 78_2d_fft/starter
- 80_grouped_query_attention/starter
- 81_int4_matmul/starter
- 82_linear_recurrence/starter
- 85_lora_linear/starter
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
79 | 94 | | |
80 | 95 | | |
81 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
12 | 24 | | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
16 | 28 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
12 | 22 | | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
12 | 22 | | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
Lines changed: 28 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
| 17 | + | |
9 | 18 | | |
10 | 19 | | |
11 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
12 | 28 | | |
13 | 29 | | |
14 | 30 | | |
15 | 31 | | |
16 | 32 | | |
17 | 33 | | |
18 | 34 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
23 | 45 | | |
24 | 46 | | |
25 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
12 | 22 | | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
0 commit comments