Uh oh!
There was an error while loading. Please reload this page.
Linker: speedup and debug info preservation - #21
Conversation
schell
commented
Sep 29, 2024
@Firestar99 I'm trying this out on |
schell
commented
Sep 29, 2024
I ran into this compilation error with |
schell
commented
Sep 29, 2024
Running |
schell
commented
Sep 29, 2024
I'm getting a lot of one error (over and over) when building The code is pretty innocuous, and compiled on the previous nightly: impl<T:SlabItem + Copy + Default,constN:usize>SlabItemfor[T;N]{constSLAB_SIZE:usize = { <TasSlabItem>::SLAB_SIZE*N};fnread_slab(index:usize,slab:&[u32]) -> Self{letmut array = [T::default();N];for i in0..N{let j = index + i *T::SLAB_SIZE;let t = T::read_slab(j, slab);let a:&mutT = crate::array_index_mut(&mut array, i);*a = t;}
array
}fnwrite_slab(&self,mutindex:usize,slab:&mut[u32]) -> usize{for i in0..N{let n = crate::slice_index(self, i);
index = n.write_slab(index, slab);}
index
}} |
Now I guess the question is - is this related to changes in EDIT: obviously not in the standard library as this is |
Adding a letmut array:[T;N] = Default::default();got it compiling. After that everything seems to work as expected in my project. But I think |
schell
commented
Sep 29, 2024
The great news is that my shaders compile much faster on this branch. 5 seconds vs the previous 40 seconds! An ~87% reduction - that's pretty epic! |
If let t = ...;[t.clone(), t.clone(), t.clone(), ..., t.clone()]
drop(t)But curiously this code from my codebase #[inline]unsafefnread(from:Self::Transfer) -> Self{unsafe{letmut ret = [T::default();N];for i in0..N{*ret.index_unchecked_mut(i) = T::read(*from.index_unchecked(i));}
ret
}}Could you check your |
schell
commented
Sep 30, 2024
I don't think it would, as
I'm not going to make a fuss, but something changed, and I think we should be able to initialize arrays this way, but it doesn't block me, and I've already released a new |
I think we should at the very least track down what changed and why and then decide the way forward. Good catch! |
4c4c77a to
18d6d38Compare18d6d38 to
ce5558cComparece5558c to
6dbfe05CompareLegNeato
commented
Mar 13, 2025
Lame, I screwed up the merge because I used github's UI. |
Firestar99
commented
Mar 17, 2025
Rebased it for you :D |
LegNeato
commented
Mar 17, 2025
@Firestar99 do you think these WIP commits are landable? I actually started working on a different speedup for this section of the code before I remembered about this PR ha. |
LegNeato
commented
Mar 17, 2025
They look fine to me, and there are some tests, and it is fairly self-contained...but 🤷 |
Firestar99
commented
Mar 17, 2025
I've been using the non-rebased version for the entirety of my masters and have not encountered a single issue. That's all the guarantees I can give you, but I'd still say this is mergeable. |
LegNeato
commented
Mar 17, 2025
Sweet, let's do it! |
Hidden command to dump usage for README
Requires #20 to be merged first. Contains a lot of WIP commits.
Some improvements to the linker by @eddyb:
This PR contains a lot of WIP commits, but it has worked flawlessly in tests and in my Project.