Re: [PATCH v5 5/5] gpu: nova-core: add ChannelIdPool
From: John Hubbard
Date: Thu Aug 13 2026 - 17:39:51 EST
On 8/13/26 1:58 PM, Gary Guo wrote:
> On Thu Aug 13, 2026 at 9:48 PM BST, Danilo Krummrich wrote:
>> On Thu Aug 13, 2026 at 8:32 PM CEST, Yury Norov wrote:
...
>> The code from Eliot does actually already takes advantage of this. In
>>
>> pool.alloc_area(nz::<8>(), Alignment::new::<8>())?;
>
> I have to say this looks quite ugly, compared to just `.alloc_area(8, 8)`. In
> this case I'd go with something aesthetically better...
In addition to aesthetics, a practical concern is that there is a
higher cognitive load to both reading and writing the longer form,
above. Perhaps that is just the price one must pay.
However, for primitive types, I am hearing (even from Miguel) that
there might be a way to get the static checking *and* an easier
interface.
Here's hoping you all can find a way to do that. :)
>
> While keeping invariants with types is generally good, for primitives I'm never
> a big fan of `NonZero` and `Bounded`... The turbofishes are just ugly and they
> are must harder to use compared to raw primitives without typing a lot of
> symbols.
thanks,
--
John Hubbard