Skip to content

checker: add passes for top level decls - #26589

Merged
spytheman merged 1 commit into
vlang:masterfrom
dy-tea:fixed-noskip
Feb 14, 2026
Merged

spytheman merged 1 commit into
vlang:masterfrom
dy-tea:fixed-noskip

Conversation

@dy-tea

@dy-tea dy-tea commented Feb 12, 2026 •

Copy link
Copy Markdown
Member

See #26306

Fixed arrays were getting a _v_ prefix in -no-skip-unused. This patch makes only the outer dimension get this prefix.

This patch was a test of Claude on the V codebase; I made sure to clean up the code (as it touched cgen before, even though I told it not to).

Might also want to add // vtest vflags: -no-skip-unused to the related test.

See #26589 (comment).

@Delta456 Delta456 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a regression test for this?

@dy-tea

dy-tea commented Feb 12, 2026

Copy link
Copy Markdown
Member Author

The test is already there but I can set it to use -no-skip-unused.

@JalonSolov

Copy link
Copy Markdown
Collaborator

Shouldn't it test both ways?

@dy-tea

dy-tea commented Feb 12, 2026

Copy link
Copy Markdown
Member Author

Will add both ways.

Comment thread vlib/v/gen/c/cgen.v Outdated
Comment thread vlib/v/checker/checker.v Outdated
@dy-tea dy-tea changed the title checker: fix name of fixed array in -no-skip-unused checker: add passes for top level decls Feb 13, 2026
@dy-tea
dy-tea requested a review from spytheman February 13, 2026 20:08
@spytheman

Copy link
Copy Markdown
Contributor

The results of ./v run .github/workflows/compare_pr_to_master.v look good:

Details ``` #0 03:05:01 ^ fixed-noskip ~/v>./v run .github/workflows/compare_pr_to_master.v ================================================================================================== Current git branch: fixed-noskip, commit: 7a9a234 Compiling new V executables from PR branch: fixed-noskip, commit: 7a9a234 ... CPU: 3.52s Real: 3.84s Elapsed: 0:03.84 RAM: 461016KB ./v -o vnew1 cmd/v CPU: 4.26s Real: 6.03s Elapsed: 0:06.03 RAM: 460972KB ./vnew1 -o vnew2 cmd/v CPU: 3.11s Real: 3.38s Elapsed: 0:03.38 RAM: 460936KB ./vnew2 -no-parallel -o vnew cmd/v CPU: 0.18s Real: 0.21s Elapsed: 0:00.21 RAM: 47692KB ./vnew -no-parallel -o nhw_current.c examples/hello_world.v CPU: 0.19s Real: 0.22s Elapsed: 0:00.22 RAM: 47956KB ./vnew -no-parallel -o nhw_current_gcc.c -cc gcc examples/hello_world.v CPU: 2.67s Real: 2.89s Elapsed: 0:02.89 RAM: 460948KB ./vnew -no-parallel -o nv_current.c cmd/v >Size of nhw_current.c: 28184 >Size of nhw_current_gcc.c: 41270 >Size of nv_current.c: 7302717 >Size of vnew: 10949722 Switched to branch 'v_repo_master' Your branch is up to date with 'V_REPO/master'. ================================================================================================== Compiling old V executables from branch: v_repo_master, commit: 1b6832b ... CPU: 3.08s Real: 3.36s Elapsed: 0:03.36 RAM: 461144KB ./v -o vold1 cmd/v CPU: 3.08s Real: 3.36s Elapsed: 0:03.36 RAM: 461152KB ./vold1 -o vold2 cmd/v CPU: 3.12s Real: 3.36s Elapsed: 0:03.36 RAM: 461132KB ./vold2 -no-parallel -o vold cmd/v CPU: 0.18s Real: 0.21s Elapsed: 0:00.21 RAM: 47696KB ./vold -no-parallel -o ohw_master.c examples/hello_world.v CPU: 0.19s Real: 0.21s Elapsed: 0:00.21 RAM: 47964KB ./vold -no-parallel -o ohw_master_gcc.c -cc gcc examples/hello_world.v CPU: 2.66s Real: 2.89s Elapsed: 0:02.89 RAM: 461104KB ./vold -no-parallel -o ov_master.c cmd/v >Size of ohw_master.c: 28184 >Size of ohw_master_gcc.c: 41270 >Size of ov_master.c: 7304386 >Size of vold: 10952560 ================================================================================================== File sizes so far ... >>>>>> size(" nhw_current.c") - size(" ohw_master.c") = 28184 - 28184 = 0 >>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") = 41270 - 41270 = 0 >>>>>> size(" nv_current.c") - size(" ov_master.c") = 7302717 - 7304386 = -1669 >>>>>> size(" vnew") - size(" vold") = 10949722 - 10952560 = -2838 Switched to branch 'fixed-noskip' ================================================================================================== Measuring at PR branch: fixed-noskip, commit: 7a9a234 ... Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 2995.833 ms 1 -0.2% 1.00x faster 123.0ms Β± Οƒ: 0.1ms, 122.8ms… 123.2ms `./vnew -check-syntax examples/hello_world.v` > 2 base 123.3ms Β± Οƒ: 0.7ms, 122.8ms… 124.3ms `./vold -check-syntax examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 2986.329 ms 1 -0.1% 1.00x ~same~ 123.0ms Β± Οƒ: 0.1ms, 122.9ms… 123.0ms `./vnew -check-syntax examples/hello_world.v` > 2 base 123.1ms Β± Οƒ: 0.1ms, 123.0ms… 123.2ms `./vold -check-syntax examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 2984.186 ms > 1 base 123.0ms Β± Οƒ: 0.1ms, 122.8ms… 123.0ms `./vold -check-syntax examples/hello_world.v` 2 +0.2% 1.00x slower 123.2ms Β± Οƒ: 0.2ms, 123.0ms… 123.4ms `./vnew -check-syntax examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 4637.531 ms 1 -0.1% 1.00x ~same~ 191.3ms Β± Οƒ: 0.1ms, 191.2ms… 191.5ms `./vnew -check examples/hello_world.v` > 2 base 191.5ms Β± Οƒ: 0.1ms, 191.5ms… 191.6ms `./vold -check examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 4631.217 ms > 1 base 191.7ms Β± Οƒ: 0.2ms, 191.6ms… 192.1ms `./vold -check examples/hello_world.v` 2 +0.2% 1.00x slower 192.2ms Β± Οƒ: 0.3ms, 191.8ms… 192.4ms `./vnew -check examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 4633.938 ms > 1 base 191.7ms Β± Οƒ: 0.7ms, 190.9ms… 192.6ms `./vold -check examples/hello_world.v` 2 +0.1% 1.00x ~same~ 191.8ms Β± Οƒ: 0.1ms, 191.7ms… 191.9ms `./vnew -check examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 5090.146 ms 1 -0.2% 1.00x faster 210.4ms Β± Οƒ: 0.2ms, 210.1ms… 210.6ms `./vnew -no-parallel -o nhw.c examples/hello_world.v` > 2 base 210.8ms Β± Οƒ: 0.0ms, 210.8ms… 210.8ms `./vold -no-parallel -o ohw.c examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 5097.940 ms 1 -0.5% 1.00x faster 210.5ms Β± Οƒ: 0.2ms, 210.2ms… 210.8ms `./vnew -no-parallel -o nhw.c examples/hello_world.v` > 2 base 211.4ms Β± Οƒ: 0.5ms, 210.8ms… 211.8ms `./vold -no-parallel -o ohw.c examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 5098.744 ms > 1 base 211.0ms Β± Οƒ: 0.1ms, 210.8ms… 211.0ms `./vold -no-parallel -o ohw.c examples/hello_world.v` 2 +0.2% 1.00x slower 211.3ms Β± Οƒ: 0.2ms, 211.0ms… 211.5ms `./vnew -no-parallel -o nhw.c examples/hello_world.v` >>>>>> size(" nhw.c") - size(" ohw.c") = 28184 - 28184 = 0 Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 5391.486 ms > 1 base 223.0ms Β± Οƒ: 0.6ms, 222.2ms… 223.5ms `./vold -no-parallel -o ohw.exe examples/hello_world.v` 2 +0.0% 1.00x ~same~ 223.1ms Β± Οƒ: 0.4ms, 222.7ms… 223.6ms `./vnew -no-parallel -o nhw.exe examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 5382.917 ms > 1 base 222.5ms Β± Οƒ: 0.3ms, 222.1ms… 222.9ms `./vold -no-parallel -o ohw.exe examples/hello_world.v` 2 +0.1% 1.00x ~same~ 222.7ms Β± Οƒ: 0.3ms, 222.4ms… 223.1ms `./vnew -no-parallel -o nhw.exe examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 5383.618 ms 1 -0.3% 1.00x faster 222.8ms Β± Οƒ: 0.1ms, 222.7ms… 223.0ms `./vnew -no-parallel -o nhw.exe examples/hello_world.v` > 2 base 223.5ms Β± Οƒ: 0.2ms, 223.2ms… 223.7ms `./vold -no-parallel -o ohw.exe examples/hello_world.v` >>>>>> size(" nhw.exe") - size(" ohw.exe") = 242392 - 242392 = 0 Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 24503.052 ms > 1 base 1019.0ms Β± Οƒ: 0.1ms, 1018.8ms…1019.1ms `./vold -check-syntax cmd/v` 2 +0.0% 1.00x ~same~ 1019.1ms Β± Οƒ: 0.3ms, 1018.6ms…1019.3ms `./vnew -check-syntax cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 24513.839 ms 1 -0.0% 1.00x ~same~ 1019.4ms Β± Οƒ: 0.5ms, 1018.8ms…1020.1ms `./vnew -check-syntax cmd/v` > 2 base 1019.9ms Β± Οƒ: 0.4ms, 1019.4ms…1020.4ms `./vold -check-syntax cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 24522.809 ms > 1 base 1019.8ms Β± Οƒ: 0.9ms, 1018.6ms…1020.5ms `./vold -check-syntax cmd/v` 2 +0.1% 1.00x ~same~ 1020.6ms Β± Οƒ: 0.1ms, 1020.5ms…1020.8ms `./vnew -check-syntax cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 44430.393 ms > 1 base 1848.1ms Β± Οƒ: 0.2ms, 1847.9ms…1848.3ms `./vold -check cmd/v` 2 +0.0% 1.00x ~same~ 1848.2ms Β± Οƒ: 0.3ms, 1847.9ms…1848.5ms `./vnew -check cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 44446.478 ms > 1 base 1846.7ms Β± Οƒ: 0.8ms, 1846.0ms…1847.8ms `./vold -check cmd/v` 2 +0.1% 1.00x ~same~ 1849.5ms Β± Οƒ: 0.9ms, 1848.2ms…1850.5ms `./vnew -check cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 44449.850 ms 1 -0.0% 1.00x ~same~ 1849.2ms Β± Οƒ: 0.8ms, 1848.1ms…1849.9ms `./vnew -check cmd/v` > 2 base 1849.3ms Β± Οƒ: 1.8ms, 1847.3ms…1851.6ms `./vold -check cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 69453.839 ms 1 -0.5% 1.00x faster 2882.8ms Β± Οƒ: 0.8ms, 2882.0ms…2883.9ms `./vnew -no-parallel -o nv.c cmd/v` > 2 base 2896.1ms Β± Οƒ: 0.9ms, 2895.0ms…2897.2ms `./vold -no-parallel -o ov.c cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 69458.013 ms 1 -0.2% 1.00x faster 2887.5ms Β± Οƒ: 0.4ms, 2887.0ms…2888.0ms `./vnew -no-parallel -o nv.c cmd/v` > 2 base 2894.6ms Β± Οƒ: 1.4ms, 2893.2ms…2896.4ms `./vold -no-parallel -o ov.c cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 69482.330 ms 1 -0.3% 1.00x faster 2886.6ms Β± Οƒ: 1.8ms, 2884.1ms…2888.3ms `./vnew -no-parallel -o nv.c cmd/v` > 2 base 2896.7ms Β± Οƒ: 1.7ms, 2894.3ms…2897.9ms `./vold -no-parallel -o ov.c cmd/v` >>>>>> size(" nv.c") - size(" ov.c") = 7302720 - 7302720 = 0 Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 80564.194 ms 1 -0.3% 1.00x faster 3348.8ms Β± Οƒ: 2.7ms, 3344.9ms…3351.1ms `./vnew -no-parallel -o nv.exe cmd/v` > 2 base 3359.0ms Β± Οƒ: 0.3ms, 3358.7ms…3359.3ms `./vold -no-parallel -o ov.exe cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 80555.918 ms 1 -0.4% 1.00x faster 3345.6ms Β± Οƒ: 1.1ms, 3344.1ms…3346.6ms `./vnew -no-parallel -o nv.exe cmd/v` > 2 base 3358.4ms Β± Οƒ: 1.7ms, 3356.0ms…3359.8ms `./vold -no-parallel -o ov.exe cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 80568.026 ms 1 -0.3% 1.00x faster 3350.4ms Β± Οƒ: 0.3ms, 3350.0ms…3350.7ms `./vnew -no-parallel -o nv.exe cmd/v` > 2 base 3359.1ms Β± Οƒ: 0.3ms, 3358.7ms…3359.3ms `./vold -no-parallel -o ov.exe cmd/v` >>>>>> size(" nv.exe") - size(" ov.exe") = 10949740 - 10949740 = 0 Done. Total time: 742.653497309 s. ================================================================================================== Final summary for file diff sizes on their own branches: >>>>>> size(" nhw_current.c") - size(" ohw_master.c") = 28184 - 28184 = 0 >>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") = 41270 - 41270 = 0 >>>>>> size(" nv_current.c") - size(" ov_master.c") = 7302717 - 7304386 = -1669 >>>>>> size(" vnew") - size(" vold") = 10949722 - 10952560 = -2838 ================================================================================================== Final summary for file diff sizes for generated files on the *current* branch: >>>>>> size(" nhw.c") - size(" ohw.c") = 28184 - 28184 = 0 >>>>>> size(" nv.c") - size(" ov.c") = 7302720 - 7302720 = 0 >>>>>> size(" nhw.exe") - size(" ohw.exe") = 242392 - 242392 = 0 >>>>>> size(" nv.exe") - size(" ov.exe") = 10949740 - 10949740 = 0 #0 03:17:28 ^ fixed-noskip ~/v> ```

The results of ./v run .github/workflows/compare_pr_to_master.v -prod look ok too:

Details ``` #0 03:28:15 ^ fixed-noskip ~/v> #0 03:28:15 ^ fixed-noskip ~/v>./v run .github/workflows/compare_pr_to_master.v -prod ================================================================================================== Current git branch: fixed-noskip, commit: 7a9a234 Compiling new V executables from PR branch: fixed-noskip, commit: 7a9a234 ... CPU: 3.09s Real: 3.35s Elapsed: 0:03.35 RAM: 461004KB ./v -o vnew1 cmd/v CPU: 3.07s Real: 3.35s Elapsed: 0:03.35 RAM: 460944KB ./vnew1 -o vnew2 cmd/v CPU: 3.07s Real: 3.34s Elapsed: 0:03.34 RAM: 460960KB ./vnew2 -no-parallel -o vnew cmd/v CPU: 0.18s Real: 0.21s Elapsed: 0:00.21 RAM: 47688KB ./vnew -no-parallel -o nhw_current.c examples/hello_world.v CPU: 0.19s Real: 0.21s Elapsed: 0:00.21 RAM: 47956KB ./vnew -no-parallel -o nhw_current_gcc.c -cc gcc examples/hello_world.v CPU: 2.62s Real: 2.88s Elapsed: 0:02.88 RAM: 460944KB ./vnew -no-parallel -o nv_current.c cmd/v CPU: 118.19s Real: 121.82s Elapsed: 2:01.82 RAM: 462568KB ./vnew -no-parallel -prod -o vnew_prod cmd/v >Size of nhw_current.c: 28184 >Size of nhw_current_gcc.c: 41270 >Size of nv_current.c: 7302717 >Size of vnew: 10949722 >Size of vnew_prod: 4591640 Switched to branch 'v_repo_master' Your branch is up to date with 'V_REPO/master'. ================================================================================================== Compiling old V executables from branch: v_repo_master, commit: 1b6832b ... CPU: 3.06s Real: 3.35s Elapsed: 0:03.35 RAM: 461128KB ./v -o vold1 cmd/v CPU: 3.11s Real: 3.36s Elapsed: 0:03.36 RAM: 461124KB ./vold1 -o vold2 cmd/v CPU: 3.09s Real: 3.36s Elapsed: 0:03.36 RAM: 461104KB ./vold2 -no-parallel -o vold cmd/v CPU: 0.18s Real: 0.20s Elapsed: 0:00.20 RAM: 47700KB ./vold -no-parallel -o ohw_master.c examples/hello_world.v CPU: 0.18s Real: 0.21s Elapsed: 0:00.21 RAM: 47964KB ./vold -no-parallel -o ohw_master_gcc.c -cc gcc examples/hello_world.v CPU: 2.65s Real: 2.90s Elapsed: 0:02.90 RAM: 461092KB ./vold -no-parallel -o ov_master.c cmd/v CPU: 116.81s Real: 120.16s Elapsed: 2:00.16 RAM: 462836KB ./vold -no-parallel -prod -o vold_prod cmd/v >Size of vold_prod: 4591672 >Size of ohw_master.c: 28184 >Size of ohw_master_gcc.c: 41270 >Size of ov_master.c: 7304386 >Size of vold: 10952560 >Size of vold_prod: 4591672 ================================================================================================== File sizes so far ... >>>>>> size(" nhw_current.c") - size(" ohw_master.c") = 28184 - 28184 = 0 >>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") = 41270 - 41270 = 0 >>>>>> size(" nv_current.c") - size(" ov_master.c") = 7302717 - 7304386 = -1669 >>>>>> size(" vnew") - size(" vold") = 10949722 - 10952560 = -2838 Switched to branch 'fixed-noskip' ================================================================================================== Measuring at PR branch: fixed-noskip, commit: 7a9a234 ... Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 1178.271 ms 1 -0.1% 1.00x ~same~ 48.6ms Β± Οƒ: 0.0ms, 48.6ms… 48.6ms `./vnew_prod -check-syntax examples/hello_world.v` > 2 base 48.7ms Β± Οƒ: 0.0ms, 48.6ms… 48.7ms `./vold_prod -check-syntax examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 1177.863 ms 1 -0.3% 1.00x faster 48.6ms Β± Οƒ: 0.1ms, 48.4ms… 48.7ms `./vnew_prod -check-syntax examples/hello_world.v` > 2 base 48.7ms Β± Οƒ: 0.0ms, 48.7ms… 48.8ms `./vold_prod -check-syntax examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 1178.323 ms 1 -0.2% 1.00x faster 48.6ms Β± Οƒ: 0.0ms, 48.5ms… 48.7ms `./vnew_prod -check-syntax examples/hello_world.v` > 2 base 48.7ms Β± Οƒ: 0.0ms, 48.6ms… 48.7ms `./vold_prod -check-syntax examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 1781.954 ms 1 -0.5% 1.01x faster 73.5ms Β± Οƒ: 0.2ms, 73.3ms… 73.7ms `./vnew_prod -check examples/hello_world.v` > 2 base 73.8ms Β± Οƒ: 0.1ms, 73.7ms… 73.9ms `./vold_prod -check examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 1781.950 ms 1 -0.5% 1.00x faster 73.5ms Β± Οƒ: 0.0ms, 73.4ms… 73.5ms `./vnew_prod -check examples/hello_world.v` > 2 base 73.8ms Β± Οƒ: 0.0ms, 73.8ms… 73.8ms `./vold_prod -check examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 1780.169 ms 1 -0.4% 1.00x faster 73.5ms Β± Οƒ: 0.1ms, 73.5ms… 73.6ms `./vnew_prod -check examples/hello_world.v` > 2 base 73.8ms Β± Οƒ: 0.0ms, 73.8ms… 73.9ms `./vold_prod -check examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 2019.067 ms 1 -0.4% 1.00x faster 83.6ms Β± Οƒ: 0.0ms, 83.5ms… 83.6ms `./vnew_prod -no-parallel -o nhw.c examples/hello_world.v` > 2 base 83.9ms Β± Οƒ: 0.0ms, 83.8ms… 84.0ms `./vold_prod -no-parallel -o ohw.c examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 2017.282 ms 1 -0.3% 1.00x faster 83.4ms Β± Οƒ: 0.0ms, 83.3ms… 83.4ms `./vnew_prod -no-parallel -o nhw.c examples/hello_world.v` > 2 base 83.6ms Β± Οƒ: 0.0ms, 83.5ms… 83.6ms `./vold_prod -no-parallel -o ohw.c examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 2016.182 ms 1 -0.5% 1.01x faster 83.1ms Β± Οƒ: 0.0ms, 83.1ms… 83.2ms `./vnew_prod -no-parallel -o nhw.c examples/hello_world.v` > 2 base 83.6ms Β± Οƒ: 0.0ms, 83.5ms… 83.6ms `./vold_prod -no-parallel -o ohw.c examples/hello_world.v` >>>>>> size(" nhw.c") - size(" ohw.c") = 28184 - 28184 = 0 Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 2303.486 ms 1 -0.2% 1.00x faster 95.2ms Β± Οƒ: 0.1ms, 95.1ms… 95.4ms `./vnew_prod -no-parallel -o nhw.exe examples/hello_world.v` > 2 base 95.4ms Β± Οƒ: 0.0ms, 95.4ms… 95.5ms `./vold_prod -no-parallel -o ohw.exe examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 2307.885 ms 1 -0.3% 1.00x faster 95.4ms Β± Οƒ: 0.0ms, 95.3ms… 95.4ms `./vnew_prod -no-parallel -o nhw.exe examples/hello_world.v` > 2 base 95.7ms Β± Οƒ: 0.1ms, 95.5ms… 95.8ms `./vold_prod -no-parallel -o ohw.exe examples/hello_world.v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 2299.402 ms 1 -0.4% 1.00x faster 95.0ms Β± Οƒ: 0.1ms, 94.9ms… 95.1ms `./vnew_prod -no-parallel -o nhw.exe examples/hello_world.v` > 2 base 95.4ms Β± Οƒ: 0.1ms, 95.3ms… 95.5ms `./vold_prod -no-parallel -o ohw.exe examples/hello_world.v` >>>>>> size(" nhw.exe") - size(" ohw.exe") = 242392 - 242392 = 0 Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 9075.084 ms > 1 base 376.0ms Β± Οƒ: 0.3ms, 375.6ms… 376.3ms `./vold_prod -check-syntax cmd/v` 2 +0.2% 1.00x slower 376.9ms Β± Οƒ: 0.2ms, 376.7ms… 377.1ms `./vnew_prod -check-syntax cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 9090.103 ms 1 -0.0% 1.00x ~same~ 376.3ms Β± Οƒ: 0.2ms, 376.0ms… 376.5ms `./vnew_prod -check-syntax cmd/v` > 2 base 376.4ms Β± Οƒ: 0.5ms, 375.8ms… 377.1ms `./vold_prod -check-syntax cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 9074.405 ms > 1 base 376.0ms Β± Οƒ: 0.5ms, 375.4ms… 376.6ms `./vold_prod -check-syntax cmd/v` 2 +0.3% 1.00x slower 377.0ms Β± Οƒ: 0.3ms, 376.7ms… 377.4ms `./vnew_prod -check-syntax cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 16527.703 ms > 1 base 684.7ms Β± Οƒ: 0.3ms, 684.4ms… 685.2ms `./vold_prod -check cmd/v` 2 +0.3% 1.00x slower 686.7ms Β± Οƒ: 0.5ms, 686.0ms… 687.3ms `./vnew_prod -check cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 16525.801 ms > 1 base 686.4ms Β± Οƒ: 0.7ms, 685.4ms… 687.0ms `./vold_prod -check cmd/v` 2 +0.1% 1.00x ~same~ 686.9ms Β± Οƒ: 0.3ms, 686.6ms… 687.3ms `./vnew_prod -check cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 16533.385 ms > 1 base 686.1ms Β± Οƒ: 0.3ms, 685.7ms… 686.5ms `./vold_prod -check cmd/v` 2 +0.1% 1.00x ~same~ 687.0ms Β± Οƒ: 0.4ms, 686.5ms… 687.3ms `./vnew_prod -check cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 27936.575 ms > 1 base 1159.9ms Β± Οƒ: 0.4ms, 1159.3ms…1160.4ms `./vold_prod -no-parallel -o ov.c cmd/v` 2 +0.1% 1.00x ~same~ 1161.4ms Β± Οƒ: 1.3ms, 1160.1ms…1163.1ms `./vnew_prod -no-parallel -o nv.c cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 27915.558 ms > 1 base 1160.4ms Β± Οƒ: 0.6ms, 1159.7ms…1160.9ms `./vold_prod -no-parallel -o ov.c cmd/v` 2 +0.1% 1.00x ~same~ 1161.3ms Β± Οƒ: 0.6ms, 1160.7ms…1162.0ms `./vnew_prod -no-parallel -o nv.c cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 27918.785 ms > 1 base 1159.1ms Β± Οƒ: 1.6ms, 1156.9ms…1160.3ms `./vold_prod -no-parallel -o ov.c cmd/v` 2 +0.3% 1.00x slower 1162.2ms Β± Οƒ: 0.1ms, 1162.1ms…1162.3ms `./vnew_prod -no-parallel -o nv.c cmd/v` >>>>>> size(" nv.c") - size(" ov.c") = 7302725 - 7302725 = 0 Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 1/3, took: 39008.540 ms > 1 base 1620.3ms Β± Οƒ: 0.9ms, 1619.2ms…1621.3ms `./vold_prod -no-parallel -o ov.exe cmd/v` 2 +0.2% 1.00x slower 1623.8ms Β± Οƒ: 0.8ms, 1622.8ms…1624.8ms `./vnew_prod -no-parallel -o nv.exe cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 2/3, took: 39007.131 ms > 1 base 1619.8ms Β± Οƒ: 0.9ms, 1618.9ms…1621.0ms `./vold_prod -no-parallel -o ov.exe cmd/v` 2 +0.3% 1.00x slower 1624.2ms Β± Οƒ: 0.5ms, 1623.5ms…1624.6ms `./vnew_prod -no-parallel -o nv.exe cmd/v` Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs: 7, repeat: 3/3, took: 39039.533 ms > 1 base 1623.0ms Β± Οƒ: 1.2ms, 1621.3ms…1624.0ms `./vold_prod -no-parallel -o ov.exe cmd/v` 2 +0.1% 1.00x ~same~ 1624.6ms Β± Οƒ: 0.9ms, 1623.5ms…1625.8ms `./vnew_prod -no-parallel -o nv.exe cmd/v` >>>>>> size(" nv.exe") - size(" ov.exe") = 10949740 - 10949740 = 0 Done. Total time: 569.136396617 s. ================================================================================================== Final summary for file diff sizes on their own branches: >>>>>> size(" nhw_current.c") - size(" ohw_master.c") = 28184 - 28184 = 0 >>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") = 41270 - 41270 = 0 >>>>>> size(" nv_current.c") - size(" ov_master.c") = 7302717 - 7304386 = -1669 >>>>>> size(" vnew") - size(" vold") = 10949722 - 10952560 = -2838 >>>>>> size(" vnew_prod") - size(" vold_prod") = 4591640 - 4591672 = -32 ================================================================================================== Final summary for file diff sizes for generated files on the *current* branch: >>>>>> size(" nhw.c") - size(" ohw.c") = 28184 - 28184 = 0 >>>>>> size(" nv.c") - size(" ov.c") = 7302725 - 7302725 = 0 >>>>>> size(" nhw.exe") - size(" ohw.exe") = 242392 - 242392 = 0 >>>>>> size(" nv.exe") - size(" ov.exe") = 10949740 - 10949740 = 0 #0 03:37:50 ^ fixed-noskip ~/v> ```

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.
Thank you @dy-tea πŸ™‡πŸ» .

Comment thread vlib/v/checker/checker.v
Comment on lines +322 to +337
c.stmt_level = 0
for mut stmt in ast_file.stmts {
if mut stmt is ast.FnDecl {
return_sym := c.table.sym(stmt.return_type)
if return_sym.info is ast.ArrayFixed
&& c.array_fixed_has_unresolved_size(return_sym.info) {
unsafe {
c.unresolved_fixed_sizes << &stmt
}
}
}
}

if c.unresolved_fixed_sizes.len > 0 {
c.update_unresolved_fixed_sizes()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is needed since after the first pass, there may not be unresolved Type sizes left πŸ€” .

@spytheman
spytheman merged commit dfd9673 into vlang:master Feb 14, 2026
90 checks passed
@dy-tea
dy-tea deleted the fixed-noskip branch February 14, 2026 13:50
cestef pushed a commit to cestef/v that referenced this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vlib/v/tests/consts/const_fixed_array_return_unresolved_test.v fails to compile with -no-skip-unused

4 participants