This would indeed be really helpful! I've been bitten by this before, so I
like this idea (more logging for VectorUtilProvider with better visibility
to users).

On Fri, Feb 6, 2026 at 12:29 PM Chris Hostetter <[email protected]>
wrote:

>
> : There is no native code involved at all. This just uses the Panama
> Vector or
> : the simple implementation. The IMPL instance is initialized as soon as
>
> Sorry -- I didn't mean to imply that lucene was using native code
> *directly* (ie: JNI).  I just picked those hypothetical method names to
> convey what the Panama APIs do ("Interconnecting JVM and native code")
> while trying to avoid refering to the "code name" Panama directly in a
> public Lucene API.
>
> I have no strong opinions about what the public method names should be --
> just that it would be nice if they existed.
>
> Uwe: do you have a better suggestion for a
> "boolean isImplNativeCodeOptimized()" method name?
>
>
> : The problem with the logging is that its coming from different (internal)
> : places and that's not available to VectorUtil or even the provider class.
>
> To be clear: I have no problem with the logging (and no interest in
> removing it).  I'm just interested in exposing the details programaticaly,
> so applications can report/alert/fail on demand.
>
> Example usages:
>  - Solr UI could display the VectorUtil description alng with basic
> deployment details like solr & lucene version
>  - Solr UI could display a warning if your collection has DenseVector
> fields in the schema but aren't using optimized VectorUtils
>  - Some other app (where vectors are critical) might want to fail fast on
> startup if optimized VectorUtils aren't enabled
>  - etc.
>
>
> : > > Maybe something as simple as ...
> : > >
> : > > VectorUtil:
> : > >
> : > >     public static boolean isImplNativeCodeOptimized() {
> : > >       return IMPL.isNativeCodeOptimized();
> : > >     }
> : > >     public static String getImplDescription() {
> : > >       return IMPL.getDescription();
> : > >     }
> : > >
> : > > VectorUtilSupport:
> : > >
> : > >     default boolean isNativeCodeOptimized() { return false; }
> : > >     String getDescription();
> : > >
> : > > DefaultVectorUtilSupport:
> : > >
> : > >     public String getDescription() { return "Default"; }
> : > >
> : > > PanamaVectorUtilSupport:
> : > >
> : > >     public boolean isNativeCodeOptimized() { return true; }
> : > >     public String getDescription() {
> : > >       return String.format(
> : > >               Locale.ENGLISH,
> : > >               "Java vector incubator API enabled; uses
> : > > preferredBitSize=%d%s%s",
> : > >               PanamaVectorConstants.PREFERRED_VECTOR_BITSIZE,
> : > >               Constants.HAS_FAST_VECTOR_FMA ? "; FMA enabled" : "",
> : > >               VectorizationProvider.TESTS_VECTOR_SIZE.isPresent() ?
> ";
> : > > testMode enabled" : "")
> : > >     }
> : > >
> : > > PanamaVectorizationProvider:
> : > >     // change logIncubatorSetup() ...
> : > >     // call this.vectorUtilSupport.getDescription()
>
>
> -Hoss
> http://www.lucidworks.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to