This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 3137d337fe tests/checkasm/sw_ops: use new checkasm_set_func_variant()
3137d337fe is described below

commit 3137d337feed50d81ed793bd934979133dcabb0b
Author:     Niklas Haas <[email protected]>
AuthorDate: Sun Apr 19 15:27:11 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sun Jun 7 09:24:23 2026 +0000

    tests/checkasm/sw_ops: use new checkasm_set_func_variant()
    
    The current approach of re-testing the C reference for every backend
    separately leads to both confusing output (e.g. having an extra redundant
    `memcpy_c` line for every op, even those not implemented by the memcpy
    backend), as well as a lot of unnecessary wasted time re-testing and
    re-benching the same C variant for every backend.
    
    This new API function lets us test the C function only a single time, while
    simultaneously having all of the other backends implicitly compare 
themselves
    against the C reference.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 tests/checkasm/sw_ops.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/checkasm/sw_ops.c b/tests/checkasm/sw_ops.c
index ca6882dae7..cff4574627 100644
--- a/tests/checkasm/sw_ops.c
+++ b/tests/checkasm/sw_ops.c
@@ -111,7 +111,7 @@ static void set_range(AVRational *rangeq, unsigned range, 
unsigned range_def)
         *rangeq = (AVRational) { range, 1 };
 }
 
-static void check_compiled(const char *name, const SwsOpBackend *backend,
+static void check_compiled(const char *name,
                            const SwsOp *read_op, const SwsOp *write_op,
                            const int ranges[NB_PLANES],
                            const SwsCompiledOp *comp_ref,
@@ -124,7 +124,7 @@ static void check_compiled(const char *name, const 
SwsOpBackend *backend,
      */
     uintptr_t id = (uintptr_t) comp_new->func;
     id ^= (id << 6) + (id >> 2) + 0x9e3779b97f4a7c15 + comp_new->cpu_flags;
-    if (!check_key(id, "%s/%s", name, backend->name))
+    if (!check_key(id, "%s", name))
         return;
 
     declare_func(void, const SwsOpExec *, const void *, int bx, int y, int 
bx_end, int y_end);
@@ -304,17 +304,15 @@ static void check_ops(const char *name, const unsigned 
ranges[NB_PLANES],
         goto done;
     }
 
+    /* Check with the C backend to establish a reference */
+    check_compiled(name, read_op, write_op, ranges, &comp_ref, &comp_ref);
+
     /* Iterate over every other backend, and test it against the C reference */
     for (int n = 0; ff_sws_op_backends[n]; n++) {
         const SwsOpBackend *backend = ff_sws_op_backends[n];
         if (backend->hw_format != AV_PIX_FMT_NONE || backend == backend_ref)
             continue;
 
-        if (!checkasm_get_cpu_info()) {
-            /* Also test once with the existing C reference to set the 
baseline */
-            check_compiled(name, backend, read_op, write_op, ranges, 
&comp_ref, &comp_ref);
-        }
-
         SwsCompiledOp comp_new = {0};
         int ret = ff_sws_ops_compile(ctx, backend, &oplist, &comp_new);
         if (ret == AVERROR(ENOTSUP)) {
@@ -324,7 +322,9 @@ static void check_ops(const char *name, const unsigned 
ranges[NB_PLANES],
             goto done;
         }
 
-        check_compiled(name, backend, read_op, write_op, ranges, &comp_ref, 
&comp_new);
+        /* Distinguish backends from each other even with same CPU flags */
+        checkasm_set_func_variant("%s_%s", backend->name, 
checkasm_get_cpu_suffix());
+        check_compiled(name, read_op, write_op, ranges, &comp_ref, &comp_new);
         ff_sws_compiled_op_unref(&comp_new);
     }
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to