Make conversion to/from arrays generic, take 2 - #292
Conversation
|
Vello does not need any code changes, unlike for #286. Vello benchmarks improvements:
Vello benchmark regressions:
The rest is noise - small movements both ways. Full benchmark run
Codex analysis of assembly changes
VerdictThe refactor introduces a small, localized performance regression in Compared revisions:
What stayed unchangedThe straightforward load/store users— This confirms the new generic array conversion implementations inline successfully in the normal cases. What regressedThe most notable change is the u8 blend loop in [lowp/mod.rs (line 478)](/home/shnatsel/Code/vello/sparse_strips/vello_cpu/src/fine/lowp/mod.rs:478):
There are also register-allocation regressions in the high-quality filtered-image path in [image.rs (line 181)](/home/shnatsel/Code/vello/sparse_strips/vello_cpu/src/fine/common/image.rs:181):
Static SIMD instruction totals actually decrease slightly because LLVM merges duplicated loops:
That reduction is primarily a code-size improvement, not a throughput improvement: some once-per-call decisions moved into hot loops. So I would classify the result as mostly unchanged, but slightly worse in important u8 blend and filtered-image paths. It does not look like a broad load/store regression, but it is enough that I would not call the refactor performance-neutral without benchmark confirmation. No workspace files were changed during the analysis. |
A different take on #286: reduce duplicate code and allow all the same generic programming perks, without creating extra traits and disrupting the existing trait hierarchy.
This is a draft. I am going to port Vello to this to see how it feels in practice before committing to the design.