Re: [PATCH bpf-next v3 0/4] bpf: replace min/max fields with struct cnum{32,64}

Alexei Starovoitov
2026-04-25T15:20:45Z

On Sat, Apr 25, 2026 at 4:48 AM Eduard Zingerman <eddyz87@gmail.com> wrote:
>
> On Sat, 2026-04-25 at 03:05 -0700, Eduard Zingerman wrote:
> > On Fri, 2026-04-24 at 15:52 -0700, Eduard Zingerman wrote:
> > > This RFC replaces s64, u64, s32, u32 scalar range domains tracked by
> > > verifier by a pair of circular numbers (cnums): one for 64-bit domain
> > > and another for 32-bit domain. Each cnum represents a range as a
> > > single arc on the circular number line, from which signed and unsigned
> > > bounds are derived on demand. See also wrapped intervals
> > > representation as in [1].
> > >
> > > The use of such representation simplifies arithmetic and conditions
> > > handling in verifier.c and allows to express 32 <-> 64 bit deductions
> > > in a more mathematically rigorous way.
> > >
> > > [1] https://jorgenavas.github.io/papers/ACM-TOPLAS-wrapped.pdf
> >
> > Uh-oh. range_within() needs an update.
> >
> > [...]
>
> The fix is as in the attachment, the tests are still passing, but the
> stats had changed a bit. I'll send the fix formally later on Saturday.

+ if (FN(is_empty)(outer) || FN(is_empty(inner)))
+ return false;

too aggressive.
empty inner should return true, no?
If both are empty, is also 'return true' ?