ziglang/zig
261
5.9k
Fork
You've already forked zig
767

MultiArrayList: improve .items codegen #32205

Closed
wzk wants to merge 3 commits from wzk/zig:gw/multi into master
pull from: wzk/zig:gw/multi
merge into: ziglang:master
ziglang:master
ziglang:elfv2
ziglang:spork8
ziglang:restricted
ziglang:0.16.x
ziglang:panic-rewrite
ziglang:parking-futex-lockfree
ziglang:windows-Io-cleanup
ziglang:Io-watch
ziglang:ParseCommandLineOptions
ziglang:windows-async-files
ziglang:poll-ring
ziglang:debug-file-leaks-differently
ziglang:debug-file-leaks
ziglang:ProcessPrng
ziglang:elfv2-dyn
ziglang:jobserver
ziglang:threadtheft
ziglang:io-threaded-no-queue
ziglang:0.15.x
ziglang:Io.net
ziglang:comptime-allocator
ziglang:restricted-function-pointers
ziglang:cli
ziglang:wasm-linker-writer
ziglang:wrangle-writer-buffering
ziglang:sha1-stream
ziglang:async-await-demo
ziglang:fixes
ziglang:0.14.x
ziglang:ast-node-methods
ziglang:macos-debug-info
ziglang:make-vs-configure
ziglang:fuzz-macos
ziglang:sans-aro
ziglang:ArrayList-reserve
ziglang:incr-bug
ziglang:llvm-ir-nosanitize-metadata
ziglang:ci-tarballs
ziglang:ci-scripts
ziglang:threadpool
ziglang:0.12.x
ziglang:new-pkg-hash
ziglang:json-diagnostics
ziglang:more-doctests
ziglang:rework-comptime-mutation
ziglang:0.11.x
ziglang:ci-perf-comment
ziglang:stage2-async
ziglang:0.10.x
ziglang:autofix
ziglang:0.9.x
ziglang:aro
ziglang:hcs
ziglang:0.8.x
ziglang:0.7.x
Contributor
Copy link

Improve codegen for MultiArrayList.items

https://godbolt.org/z/85GjMb7qa for reference

Basically currently even under optimize build MultiArrayList requires several instructions to compute the slice offset.
This should only be two instructions or one on platform with mul-add instructions.

I think the .slice() method usage should be discouraged. Basically it's a cache of a mul-add, and there is no platform where caching this is useful.

I can remove .slice() usage from ArrayHashMap, in this PR or another, as you prefer.
Cheers

Improve codegen for MultiArrayList.items https://godbolt.org/z/85GjMb7qa for reference Basically currently even under optimize build MultiArrayList requires several instructions to compute the slice offset. This should only be two instructions or one on platform with mul-add instructions. I think the `.slice()` method usage should be discouraged. Basically it's a cache of a mul-add, and there is no platform where caching this is useful. I can remove `.slice()` usage from ArrayHashMap, in this PR or another, as you prefer. Cheers

I think the .slice() method usage should be discouraged. Basically it's a cache of a mul-add, and there is no platform where caching this is useful.

I agree, would be in favor of moving towards removing it entirely (as a follow-up).

> I think the .slice() method usage should be discouraged. Basically it's a cache of a mul-add, and there is no platform where caching this is useful. I agree, would be in favor of moving towards removing it entirely (as a follow-up).
wzk force-pushed gw/multi from 41533d34ac
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / loongarch64-linux-debug (pull_request) Waiting to run
ci / loongarch64-linux-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / s390x-linux-debug (pull_request) Waiting to run
ci / s390x-linux-release (pull_request) Waiting to run
ci / x86_64-freebsd-debug (pull_request) Waiting to run
ci / x86_64-freebsd-release (pull_request) Waiting to run
ci / x86_64-netbsd-debug (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Waiting to run
ci / x86_64-openbsd-debug (pull_request) Waiting to run
ci / x86_64-openbsd-release (pull_request) Waiting to run
ci / x86_64-windows-debug (pull_request) Waiting to run
ci / x86_64-windows-release (pull_request) Waiting to run
ci / aarch64-macos-release (pull_request) Failing after 1m7s
ci / aarch64-macos-debug (pull_request) Failing after 1m20s
ci / powerpc64le-linux-debug (pull_request) Failing after 2m32s
ci / x86_64-linux-debug (pull_request) Failing after 1m56s
ci / powerpc64le-linux-release (pull_request) Failing after 2m37s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 2m2s
ci / aarch64-linux-debug (pull_request) Failing after 2m14s
ci / aarch64-linux-release (pull_request) Failing after 2m16s
ci / x86_64-linux-release (pull_request) Failing after 4m59s
to e2dceda976
Some checks failed
ci / powerpc64le-linux-release (pull_request) Failing after 2m8s
ci / powerpc64le-linux-debug (pull_request) Failing after 2m10s
ci / aarch64-macos-debug (pull_request) Failing after 2m34s
ci / aarch64-macos-release (pull_request) Failing after 1m44s
ci / x86_64-linux-debug (pull_request) Failing after 2m24s
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
2026年05月02日 21:03:57 +02:00
Compare
wzk force-pushed gw/multi from a8627854ca
Some checks failed
ci / aarch64-macos-release (pull_request) Failing after 47s
ci / aarch64-macos-debug (pull_request) Failing after 47s
ci / x86_64-linux-debug (pull_request) Failing after 1m49s
ci / powerpc64le-linux-release (pull_request) Failing after 2m11s
ci / powerpc64le-linux-debug (pull_request) Failing after 2m15s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 2m18s
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
to 05aa91d5ed
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / loongarch64-linux-debug (pull_request) Waiting to run
ci / loongarch64-linux-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / aarch64-macos-release (pull_request) Failing after 2m11s
ci / aarch64-macos-debug (pull_request) Failing after 2m39s
ci / x86_64-linux-debug (pull_request) Failing after 8m53s
ci / powerpc64le-linux-release (pull_request) Failing after 10m44s
ci / x86_64-linux-release (pull_request) Failing after 1m57s
ci / x86_64-freebsd-debug (pull_request) Failing after 5m33s
ci / powerpc64le-linux-debug (pull_request) Failing after 13m14s
ci / x86_64-freebsd-release (pull_request) Failing after 2m43s
ci / x86_64-netbsd-debug (pull_request) Failing after 4m15s
ci / x86_64-netbsd-release (pull_request) Failing after 3m29s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 15m44s
ci / s390x-linux-debug (pull_request) Failing after 9m37s
ci / aarch64-linux-debug (pull_request) Failing after 9m2s
ci / aarch64-linux-release (pull_request) Failing after 8m6s
ci / s390x-linux-release (pull_request) Failing after 8m32s
ci / x86_64-openbsd-debug (pull_request) Failing after 4m38s
ci / x86_64-openbsd-release (pull_request) Failing after 3m4s
ci / x86_64-windows-debug (pull_request) Failing after 6m32s
ci / x86_64-windows-release (pull_request) Failing after 4m43s
2026年05月02日 21:34:15 +02:00
Compare
wzk force-pushed gw/multi from 05aa91d5ed
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / loongarch64-linux-debug (pull_request) Waiting to run
ci / loongarch64-linux-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / aarch64-macos-release (pull_request) Failing after 2m11s
ci / aarch64-macos-debug (pull_request) Failing after 2m39s
ci / x86_64-linux-debug (pull_request) Failing after 8m53s
ci / powerpc64le-linux-release (pull_request) Failing after 10m44s
ci / x86_64-linux-release (pull_request) Failing after 1m57s
ci / x86_64-freebsd-debug (pull_request) Failing after 5m33s
ci / powerpc64le-linux-debug (pull_request) Failing after 13m14s
ci / x86_64-freebsd-release (pull_request) Failing after 2m43s
ci / x86_64-netbsd-debug (pull_request) Failing after 4m15s
ci / x86_64-netbsd-release (pull_request) Failing after 3m29s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 15m44s
ci / s390x-linux-debug (pull_request) Failing after 9m37s
ci / aarch64-linux-debug (pull_request) Failing after 9m2s
ci / aarch64-linux-release (pull_request) Failing after 8m6s
ci / s390x-linux-release (pull_request) Failing after 8m32s
ci / x86_64-openbsd-debug (pull_request) Failing after 4m38s
ci / x86_64-openbsd-release (pull_request) Failing after 3m4s
ci / x86_64-windows-debug (pull_request) Failing after 6m32s
ci / x86_64-windows-release (pull_request) Failing after 4m43s
to abdcecdf19
Some checks failed
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / x86_64-linux-debug (pull_request) Failing after 11m40s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 9m21s
ci / x86_64-freebsd-release (pull_request) Failing after 25m3s
ci / x86_64-linux-release (pull_request) Failing after 6m1s
ci / x86_64-netbsd-release (pull_request) Successful in 32m21s
ci / x86_64-freebsd-debug (pull_request) Failing after 38m16s
ci / x86_64-netbsd-debug (pull_request) Successful in 43m8s
ci / x86_64-openbsd-release (pull_request) Successful in 46m46s
ci / x86_64-openbsd-debug (pull_request) Successful in 48m38s
ci / x86_64-windows-release (pull_request) Successful in 51m30s
ci / x86_64-windows-debug (pull_request) Successful in 55m48s
ci / aarch64-macos-release (pull_request) Successful in 58m56s
ci / aarch64-macos-debug (pull_request) Successful in 1h0m36s
ci / aarch64-linux-release (pull_request) Successful in 1h24m27s
ci / s390x-linux-release (pull_request) Successful in 1h26m6s
ci / powerpc64le-linux-release (pull_request) Successful in 2h7m41s
ci / aarch64-linux-debug (pull_request) Successful in 2h19m46s
ci / s390x-linux-debug (pull_request) Successful in 2h24m39s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h3m12s
ci / loongarch64-linux-release (pull_request) Successful in 2h12m13s
ci / loongarch64-linux-debug (pull_request) Successful in 3h3m38s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-release (pull_request) Successful in 2h59m24s
ci / aarch64-freebsd-debug (pull_request) Successful in 3h55m34s
2026年05月02日 23:04:23 +02:00
Compare
Member
Copy link

I find the Slice type useful as a way to pass a 'finalized' version of the contents of a MultiArrayList around (similar to the items field of an ArrayList). Maybe the type could be reworked to basically a MultiArrayList without the capacity field and recompute the appropriate offsets on demand to still be usable for that purpose.

I find the `Slice` type useful as a way to pass a 'finalized' version of the contents of a `MultiArrayList` around (similar to the `items` field of an `ArrayList`). Maybe the type could be reworked to basically a `MultiArrayList` without the `capacity` field and recompute the appropriate offsets on demand to still be usable for that purpose.
@ -221,0 +225,4 @@
field_indexes[i]=elem.field_index;
for(data[i+1..])|other_field|{
field_offsets[other_field.field_index]+=elem.size;
First-time contributor
Copy link

I'm guessing the CI error means that field alignment needs to be used to first align the offset forward before adding elem.size? Perhaps something like this could work field_offsets[other_field.field_index] = mem.alignForward(usize, field_offsets[other_field.field_index], .fromByteUnits(elem.alignment))?

Also guessing bytes_per_capacity would need similar treatment.

I'm guessing the CI error means that field alignment needs to be used to first align the offset forward before adding `elem.size`? Perhaps something like this could work `field_offsets[other_field.field_index] = mem.alignForward(usize, field_offsets[other_field.field_index], .fromByteUnits(elem.alignment))`? Also guessing `bytes_per_capacity` would need similar treatment.
Author
Contributor
Copy link

actually the issue was using @alignCast(x.bytes) when x is empty, therefore x.bytes is undefined.

actually the issue was using `@alignCast(x.bytes)` when x is empty, therefore x.bytes is undefined.
Author
Contributor
Copy link

I fixed this by improving the sorting of fields:

  • sort by increasing alignment AND size

I also had an issue with alignCast being call on the undefined pointer of the empty slice. I added a test for that regression (calling .items on empty could trigger it)

I fixed this by improving the sorting of fields: - sort by increasing alignment AND size I also had an issue with `alignCast` being call on the undefined pointer of the empty slice. I added a test for that regression (calling .items on empty could trigger it)
wzk force-pushed gw/multi from 89a0b734a6
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / loongarch64-linux-debug (pull_request) Waiting to run
ci / loongarch64-linux-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-linux-release (pull_request) Failing after 3m32s
ci / aarch64-macos-debug (pull_request) Failing after 4m45s
ci / x86_64-freebsd-debug (pull_request) Failing after 5m9s
ci / aarch64-macos-release (pull_request) Failing after 6m36s
ci / x86_64-freebsd-release (pull_request) Failing after 6m55s
ci / x86_64-windows-release (pull_request) Failing after 7m55s
ci / x86_64-netbsd-release (pull_request) Failing after 7m32s
ci / x86_64-linux-debug (pull_request) Failing after 8m5s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 8m4s
ci / x86_64-netbsd-debug (pull_request) Failing after 8m8s
ci / x86_64-windows-debug (pull_request) Failing after 8m57s
ci / x86_64-openbsd-release (pull_request) Failing after 7m33s
ci / x86_64-openbsd-debug (pull_request) Failing after 8m44s
ci / s390x-linux-release (pull_request) Failing after 10m56s
ci / s390x-linux-debug (pull_request) Failing after 11m47s
ci / aarch64-linux-release (pull_request) Failing after 11m7s
ci / aarch64-linux-debug (pull_request) Failing after 12m32s
ci / powerpc64le-linux-release (pull_request) Failing after 14m34s
ci / powerpc64le-linux-debug (pull_request) Failing after 17m0s
to 7d2f93a132
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
2026年05月04日 10:40:39 +02:00
Compare
wzk force-pushed gw/multi from 7d2f93a132
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
to f20895f772
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-linux-debug (pull_request) Failing after 8m2s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 8m7s
ci / x86_64-linux-release (pull_request) Failing after 8m13s
ci / x86_64-freebsd-release (pull_request) Failing after 33m39s
ci / x86_64-netbsd-release (pull_request) Successful in 37m54s
ci / x86_64-freebsd-debug (pull_request) Failing after 42m9s
ci / x86_64-openbsd-release (pull_request) Successful in 42m57s
ci / x86_64-windows-release (pull_request) Successful in 43m32s
ci / x86_64-netbsd-debug (pull_request) Successful in 44m4s
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
2026年05月04日 10:42:40 +02:00
Compare
Author
Contributor
Copy link

I fixed my code, I had an alignCast on possibly undefined pointer.

But I apparently broke test cases related to the lldb pretty helper, not sure how to proceed, since AFAICT I didn't change the related code, and the tests doesn't match what I would expect the code to do (Entry fields have "_ptr" suffix, while the tests don't use it)

I fixed my code, I had an alignCast on possibly undefined pointer. But I apparently broke test cases related to the lldb pretty helper, not sure how to proceed, since AFAICT I didn't change the related code, and the tests doesn't match what I would expect the code to do (Entry fields have "_ptr" suffix, while the tests don't use it)
@ -191,1 +191,4 @@
/// `sizes.big_align` is the overall alignment of the allocation, which equals the maximum field alignment.
/// `sizes.bytes_per_capacity` is the number of bytes needed per capacity, it's the sum of the size of each T fields.
/// `sizes.fields` contains the id of each field, in order of their appearance
/// `sizes.offsets` contains for each field the bytes size of each preceding fields
First-time contributor
Copy link

I found these comments a little difficult to understand. Here's my attempt to clarify. Feel free to use if you agree.

/// Describes the memory layout of the MultiArrayList./// `sizes.big_align`: the overall alignment of the allocation, equal to the maximum field alignment./// `sizes.bytes_per_capacity`: the unaligned sum of `T`'s field sizes./// `sizes.fields`: array of field ids. a mapping from alignment-sorted order to declaration order./// `sizes.offsets`: array of field offsets.
I found these comments a little difficult to understand. Here's my attempt to clarify. Feel free to use if you agree. ```zig /// Describes the memory layout of the MultiArrayList. /// `sizes.big_align`: the overall alignment of the allocation, equal to the maximum field alignment. /// `sizes.bytes_per_capacity`: the unaligned sum of `T`'s field sizes. /// `sizes.fields`: array of field ids. a mapping from alignment-sorted order to declaration order. /// `sizes.offsets`: array of field offsets. ```
Author
Contributor
Copy link

Previously failing debug tests are green now.

I restored the "sizes.bytes" comptime information because it's used by the lldb-zig fork: github.com/jacobly0/llvm-project@e0a42bb343/lldb/source/Plugins/Language/Zig/ZigStdDataFormatters.cpp (L328)

I need to send a PR there too, but will do so in a second time.

Not sure if I should rebase and retrigger the CI or if we can merge like this.

Previously failing debug tests are green now. I restored the "sizes.bytes" comptime information because it's used by the lldb-zig fork: https://github.com/jacobly0/llvm-project/blob/e0a42bb343616608f4fdd1284246f82b0d3029d7/lldb/source/Plugins/Language/Zig/ZigStdDataFormatters.cpp#L328 I need to send a PR there too, but will do so in a second time. Not sure if I should rebase and retrigger the CI or if we can merge like this.
wzk force-pushed gw/multi from ad46170ead
All checks were successful
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Successful in 38m7s
ci / x86_64-freebsd-release (pull_request) Successful in 41m28s
ci / x86_64-linux-debug (pull_request) Successful in 52m12s
ci / x86_64-freebsd-debug (pull_request) Successful in 55m45s
ci / x86_64-netbsd-debug (pull_request) Successful in 57m3s
ci / x86_64-openbsd-release (pull_request) Successful in 57m47s
ci / aarch64-macos-release (pull_request) Successful in 1h1m7s
ci / x86_64-windows-release (pull_request) Successful in 1h2m11s
ci / aarch64-macos-debug (pull_request) Successful in 1h3m38s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h5m22s
ci / x86_64-windows-debug (pull_request) Successful in 1h9m21s
ci / aarch64-linux-release (pull_request) Successful in 1h30m18s
ci / loongarch64-linux-release (pull_request) Successful in 2h2m14s
ci / s390x-linux-release (pull_request) Successful in 2h20m16s
ci / powerpc64le-linux-release (pull_request) Successful in 2h26m22s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h28m4s
ci / aarch64-linux-debug (pull_request) Successful in 2h32m34s
ci / x86_64-linux-release (pull_request) Successful in 2h54m53s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h20m3s
ci / loongarch64-linux-debug (pull_request) Successful in 3h32m34s
ci / s390x-linux-debug (pull_request) Successful in 4h53m52s
ci / aarch64-freebsd-debug (pull_request) Successful in 3h53m56s
ci / aarch64-freebsd-release (pull_request) Successful in 3h13m58s
ci / aarch64-netbsd-debug (pull_request) Successful in 4h5m44s
ci / aarch64-netbsd-release (pull_request) Successful in 3h8m28s
to 142bdbd6d6
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
2026年06月04日 11:24:52 +02:00
Compare
wzk force-pushed gw/multi from 142bdbd6d6
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
to 2379d1fb24
Some checks failed
ci / aarch64-macos-release (pull_request) Successful in 1h11m20s
ci / x86_64-freebsd-debug (pull_request) Successful in 58m56s
ci / x86_64-freebsd-release (pull_request) Successful in 59m8s
ci / x86_64-netbsd-debug (pull_request) Successful in 1h3m46s
ci / x86_64-netbsd-release (pull_request) Successful in 1h3m9s
ci / x86_64-openbsd-release (pull_request) Successful in 1h3m22s
ci / aarch64-linux-release (pull_request) Successful in 1h20m22s
ci / aarch64-macos-debug (pull_request) Successful in 2h10m9s
ci / powerpc64le-linux-release (pull_request) Successful in 2h12m33s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h23m26s
ci / x86_64-linux-debug (pull_request) Successful in 1h33m34s
ci / aarch64-linux-debug (pull_request) Successful in 2h30m12s
ci / s390x-linux-release (pull_request) Successful in 1h24m16s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h40m5s
ci / s390x-linux-debug (pull_request) Successful in 2h40m7s
ci / x86_64-linux-release (pull_request) Successful in 3h51m54s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h9m12s
ci / x86_64-windows-release (pull_request) Successful in 1h15m35s
ci / x86_64-windows-debug (pull_request) Successful in 1h21m35s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
2026年06月04日 11:27:15 +02:00
Compare
Author
Contributor
Copy link

So I had to rebase the PR because of the changes to the layout of TypeInfo.

I could have just done that, but I also removed slice() calls from ArrayHashMap.
I can revert that file if it seems like an outreach, but the original issue I observed of poor compilation was using MultiArrayList through an ArrayHashMap and have some functions doing too much work.

So I had to rebase the PR because of the changes to the layout of TypeInfo. I could have just done that, but I also removed `slice()` calls from `ArrayHashMap`. I can revert that file if it seems like an outreach, but the original issue I observed of poor compilation was using MultiArrayList through an `ArrayHashMap` and have some functions doing too much work.
andrewrk left a comment
Copy link

needs a rebase, I noticed an lldb related TODO in this diff that is not present in master branch.

restore sizes.bytes to appease the CI gods

?

you're editing core data structures. sure, let's have some fun but let's also be disciplined and explain what changes are happening in the commit and why they are happening and consider the effects of the changes

I think this could have been merged weeks ago if it were a little easier to review.

needs a rebase, I noticed an lldb related TODO in this diff that is not present in master branch. > restore sizes.bytes to appease the CI gods ? you're editing core data structures. sure, let's have some fun but let's also be disciplined and explain what changes are happening in the commit and why they are happening and consider the effects of the changes I think this could have been merged weeks ago if it were a little easier to review.
@ -268,3 +268,1 @@
.keys=slice.items(.key).ptr,
.values=slice.items(.value).ptr,
.len=@as(u32,@intCast(slice.len)),
.keys=self.keys().ptr,
Owner
Copy link

what's the purpose of this change? (don't answer on codeberg, include it in the commit message)

what's the purpose of this change? (don't answer on codeberg, include it in the commit message)
@ -383,3 +359,1 @@
.value_ptr=&slice.items(.value).ptr[index],
.found_existing=false,
.index=index,
if(self.index_header)|header|{
Owner
Copy link

what's the purpose of this change? (don't answer on codeberg, include it in the commit message)

what's the purpose of this change? (don't answer on codeberg, include it in the commit message)
Author
Contributor
Copy link

In the interest of keeping the diff minimal, I reverted the structural change (orelse -> if comprehension), and only kept the perf motivated change (.slice().items() -> .items())

In the interest of keeping the diff minimal, I reverted the structural change (orelse -> if comprehension), and only kept the perf motivated change (.slice().items() -> .items())

needs a rebase, I noticed an lldb related TODO in this diff that is not present in master branch.

oh, you added this in one of the commits in this branch and then removed it. can you just clean up your commits please?


since this has failed review twice now please make one change at a time and keep it minimal.

> needs a rebase, I noticed an lldb related TODO in this diff that is not present in master branch. oh, you added this in one of the commits in this branch and then removed it. can you just clean up your commits please? --- since this has failed review twice now please make one change at a time and keep it minimal.
wzk force-pushed gw/multi from 2379d1fb24
Some checks failed
ci / aarch64-macos-release (pull_request) Successful in 1h11m20s
ci / x86_64-freebsd-debug (pull_request) Successful in 58m56s
ci / x86_64-freebsd-release (pull_request) Successful in 59m8s
ci / x86_64-netbsd-debug (pull_request) Successful in 1h3m46s
ci / x86_64-netbsd-release (pull_request) Successful in 1h3m9s
ci / x86_64-openbsd-release (pull_request) Successful in 1h3m22s
ci / aarch64-linux-release (pull_request) Successful in 1h20m22s
ci / aarch64-macos-debug (pull_request) Successful in 2h10m9s
ci / powerpc64le-linux-release (pull_request) Successful in 2h12m33s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h23m26s
ci / x86_64-linux-debug (pull_request) Successful in 1h33m34s
ci / aarch64-linux-debug (pull_request) Successful in 2h30m12s
ci / s390x-linux-release (pull_request) Successful in 1h24m16s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h40m5s
ci / s390x-linux-debug (pull_request) Successful in 2h40m7s
ci / x86_64-linux-release (pull_request) Successful in 3h51m54s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h9m12s
ci / x86_64-windows-release (pull_request) Successful in 1h15m35s
ci / x86_64-windows-debug (pull_request) Successful in 1h21m35s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
to 335962eeb7
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
2026年06月05日 07:15:22 +02:00
Compare
wzk force-pushed gw/multi from 335962eeb7
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
to d299c8f87c
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
2026年06月05日 07:19:02 +02:00
Compare
wzk force-pushed gw/multi from d299c8f87c
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
to ec44be451b
All checks were successful
ci / x86_64-linux-debug (pull_request) Successful in 57m16s
ci / x86_64-netbsd-debug (pull_request) Successful in 52m29s
ci / x86_64-freebsd-debug (pull_request) Successful in 57m6s
ci / aarch64-macos-release (pull_request) Successful in 1h17m33s
ci / x86_64-freebsd-release (pull_request) Successful in 53m15s
ci / x86_64-netbsd-release (pull_request) Successful in 57m17s
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m43s
ci / aarch64-linux-release (pull_request) Successful in 1h22m3s
ci / aarch64-macos-debug (pull_request) Successful in 1h43m15s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h23m57s
ci / powerpc64le-linux-release (pull_request) Successful in 2h11m54s
ci / x86_64-windows-debug (pull_request) Successful in 1h20m49s
ci / x86_64-windows-release (pull_request) Successful in 1h3m50s
ci / aarch64-linux-debug (pull_request) Successful in 2h22m19s
ci / s390x-linux-release (pull_request) Successful in 1h26m18s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h12m19s
ci / s390x-linux-debug (pull_request) Successful in 2h50m56s
ci / x86_64-linux-release (pull_request) Successful in 3h56m30s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 5h20m50s
ci / loongarch64-linux-release (pull_request) Successful in 1h59m13s
ci / loongarch64-linux-debug (pull_request) Successful in 3h4m48s
ci / aarch64-freebsd-debug (pull_request) Has been skipped
ci / aarch64-freebsd-release (pull_request) Has been skipped
ci / aarch64-netbsd-debug (pull_request) Has been skipped
ci / aarch64-netbsd-release (pull_request) Has been skipped
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
2026年06月05日 07:27:05 +02:00
Compare
Author
Contributor
Copy link

sorry I did mangle commits during my rebase.
There are 3 commits now:

  • improve comptime computation of MultiArrayList to simplify .items computation (no more for loop at runtime), removal of .slice() calls in MultiArrayList
  • small commit to be reverted about the "sizes.bytes" comptime field, needed by zig-lldb
  • removal of calls to slice in ArrayHashMap

I've reverted cosmetic changes to ArrayHashMap to simplify reading the diff, and tried to improve the commit messages.
I was working under the assumption that this would get squashed in one commit.

First commit does pass test-std, but doesn't pass test-debug, so maybe I should squash the first two.

sorry I did mangle commits during my rebase. There are 3 commits now: - improve comptime computation of `MultiArrayList` to simplify `.items` computation (no more for loop at runtime), removal of `.slice()` calls in MultiArrayList - small commit to be reverted about the "sizes.bytes" comptime field, needed by zig-lldb - removal of calls to `slice` in ArrayHashMap I've reverted cosmetic changes to ArrayHashMap to simplify reading the diff, and tried to improve the commit messages. I was working under the assumption that this would get squashed in one commit. First commit does pass test-std, but doesn't pass test-debug, so maybe I should squash the first two.
andrewrk left a comment
Copy link

since this has failed review twice now please make one change at a time and keep it minimal.

> > since this has failed review twice now please make one change at a time and **keep it minimal.**
@ -184,0 +186,4 @@
/// `sizes.offsets`: array of field offsets.
/// `sizes.bytes`: array of @sizeOf each T field. Sorted by alignment.
/// Note: sizes.bytes is not used in Zig anymore, only by lldb-zig.
/// TODO: update lldb-zig to use sizes.offsets instead, and remove it.
Owner
Copy link

instead of making a TODO comment, please file a followup issue

instead of making a TODO comment, please file a followup issue
@ -660,3 +659,4 @@
}
fnallocatedBytes(self:Self)[]align(sizes.big_align.toByteUnits())u8{
// If the list is empty, self.bytes is undefined and alignCast crashes.
Owner
Copy link

These changes do not solve the stated problem. You've turned a safety crash into UB.

These changes do not solve the stated problem. You've turned a safety crash into UB.

Since you didn't follow my review feedback, I'm going to close this for now. Please start with opening an issue to track what you are trying to solve, and we can go from there.

Once you built up trust as a contributor you can start tossing more extra stuff in patches. But in the beginning let's keep it minimal.

Since you didn't follow my review feedback, I'm going to close this for now. Please **start with opening an issue** to track what you are trying to solve, and we can go from there. Once you built up trust as a contributor you can start tossing more extra stuff in patches. But in the beginning let's keep it minimal.
andrewrk closed this pull request 2026年06月11日 06:17:36 +02:00
Author
Contributor
Copy link

I did tried to follow your feedback as best as I could and did make this more minimal.
Sorry if I didn't make it worth your time.

For the record I do have a few submissions under my belt: https://github.com/ziglang/zig/pulls?q=is%3Apr+author%3Agwenzek+is%3Aclosed

I opened #35728 with hopefully a better explanation of the problem.

I did tried to follow your feedback as best as I could and did make this more minimal. Sorry if I didn't make it worth your time. For the record I do have a few submissions under my belt: https://github.com/ziglang/zig/pulls?q=is%3Apr+author%3Agwenzek+is%3Aclosed I opened https://codeberg.org/ziglang/zig/issues/35728 with hopefully a better explanation of the problem.
All checks were successful
ci / x86_64-linux-debug (pull_request) Successful in 57m16s
Required
Details
ci / x86_64-netbsd-debug (pull_request) Successful in 52m29s
Required
Details
ci / x86_64-freebsd-debug (pull_request) Successful in 57m6s
Required
Details
ci / aarch64-macos-release (pull_request) Successful in 1h17m33s
Required
Details
ci / x86_64-freebsd-release (pull_request) Successful in 53m15s
Required
Details
ci / x86_64-netbsd-release (pull_request) Successful in 57m17s
Required
Details
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m43s
Required
Details
ci / aarch64-linux-release (pull_request) Successful in 1h22m3s
Required
Details
ci / aarch64-macos-debug (pull_request) Successful in 1h43m15s
Required
Details
ci / x86_64-openbsd-debug (pull_request) Successful in 1h23m57s
Required
Details
ci / powerpc64le-linux-release (pull_request) Successful in 2h11m54s
Required
Details
ci / x86_64-windows-debug (pull_request) Successful in 1h20m49s
Required
Details
ci / x86_64-windows-release (pull_request) Successful in 1h3m50s
Required
Details
ci / aarch64-linux-debug (pull_request) Successful in 2h22m19s
Required
Details
ci / s390x-linux-release (pull_request) Successful in 1h26m18s
Required
Details
ci / powerpc64le-linux-debug (pull_request) Successful in 3h12m19s
Required
Details
ci / s390x-linux-debug (pull_request) Successful in 2h50m56s
Required
Details
ci / x86_64-linux-release (pull_request) Successful in 3h56m30s
Required
Details
ci / x86_64-linux-debug-llvm (pull_request) Successful in 5h20m50s
Required
Details
ci / loongarch64-linux-release (pull_request) Successful in 1h59m13s
ci / loongarch64-linux-debug (pull_request) Successful in 3h4m48s
ci / aarch64-freebsd-debug (pull_request) Has been skipped
ci / aarch64-freebsd-release (pull_request) Has been skipped
ci / aarch64-netbsd-debug (pull_request) Has been skipped
ci / aarch64-netbsd-release (pull_request) Has been skipped
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
abi/f32
abi/ilp32
abi/sf
accepted
This proposal is planned.
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
The web application for interactive documentation and generation of its assets.
backend/c
The C backend outputs C source code.
backend/llvm
The LLVM backend outputs an LLVM bitcode module.
backend/self-hosted
The self-hosted backends produce machine code directly.
binutils
Zig's included binary utilities: zig ar, zig dlltool, zig lib, zig ranlib, zig objcopy, and zig rc.
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
build system
The Zig build system - zig build, std.Build, the build runner, and package management.
debug info
An issue related to debug information (e.g. DWARF) produced by the Zig compiler.
docs
An issue with documentation, e.g. the language reference or standard library doc comments.
error message
This issue points out an error message that is unhelpful and should be improved.
frontend
Tokenization, parsing, AstGen, ZonGen, Sema, Legalize, and Liveness.
fuzzing
An issue related to Zig's integrated fuzz testing.
incremental
Reuse of internal compiler state for faster compilation.
lib/c
This issue relates to Zig's libc implementation and/or vendored libcs.
lib/compiler-rt
This issue relates to Zig's compiler-rt library.
lib/cxx
This issue relates to Zig's vendored libc++ and/or libc++abi.
lib/std
This issue relates to Zig's standard library.
lib/tsan
This issue relates to Zig's vendored libtsan.
lib/ubsan-rt
This issue relates to Zig's ubsan-rt library.
lib/unwind
This issue relates to Zig's vendored libunwind.
linking
Zig's integrated object file and incremental linker.
miscompilation
The compiler reports success but produces semantically incorrect code.
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
This issue suggests language modifications. If it also has the "accepted" label then it is planned.
release notes
This issue or pull request should be mentioned in the release notes.
testing
This issue is related to testing the compiler, standard library, or other parts of Zig.
zig cc
Zig as a drop-in C-family compiler.
zig fmt
The Zig source code formatter.
zig reduce
The Zig source code reduction tool.
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
No labels
abi/f32
abi/ilp32
abi/sf
accepted
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
release notes
testing
zig cc
zig fmt
zig reduce
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
use case
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig!32205
Reference in a new issue
ziglang/zig
No description provided.
Delete branch "wzk/zig:gw/multi"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?