On 01/17/2018 04:55 PM, Roland Scheidegger wrote:
That should help llvmpipe quite a bit...
Albeit 1% doesn't sound like it would give a lot of coverage, maybe a
bit more (5% or so) would still cut down the time significantly while
having less risk of missing failures?

Hmm, it looks like llvmpipe isn't just slow at running the test- it's an infinite loop!

If I let the test run until it gets stuck, the stack trace is:

(gdb) where
#0 0x00007ffff2ba0b3c in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #1 0x00007ffff2bc392b in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #2 0x00007ffff2befe8b in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #3 0x00007ffff2bf4d20 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #4 0x00007ffff2bf7245 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #5 0x00007ffff2c0141c in llvm::X86TargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #6 0x00007ffff1c42c43 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #7 0x00007ffff1c478f4 in llvm::SelectionDAG::LegalizeOp(llvm::SDNode*, llvm::SmallSetVector<llvm::SDNode*, 16u>&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #8 0x00007ffff1c09b91 in llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults&, llvm::CodeGenOpt::Level) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #9 0x00007ffff1d27657 in llvm::SelectionDAGISel::CodeGenAndEmitDAG() () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #10 0x00007ffff1d2ada0 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #11 0x00007ffff1d2c67a in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #12 0x00007ffff2b7e204 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #13 0x00007ffff195e2a2 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #14 0x00007ffff195e63b in llvm::FPPassManager::runOnModule(llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #15 0x00007ffff195deef in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #16 0x00007ffff241f562 in llvm::MCJIT::emitObject(llvm::Module*) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #17 0x00007ffff241fa09 in llvm::MCJIT::generateCodeForModule(llvm::Module*) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #18 0x00007ffff241c85c in llvm::MCJIT::finalizeObject() () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #19 0x00007ffff23ffba7 in LLVMGetPointerToGlobal () from /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 #20 0x00007ffff6a740aa in gallivm_jit_function (gallivm=0xb9d190, func=0xb4d708) at ../../../../src/gallium/auxiliary/gallivm/lp_bld_init.c:690 #21 0x00007ffff6af16be in generate_variant (lp=0x656510, shader=0x898440, key=0x7fffffffd9f0) at ../../../../../src/gallium/drivers/llvmpipe/lp_state_fs.c:2879 #22 0x00007ffff6af2e03 in llvmpipe_update_fs (lp=0x656510) at ../../../../../src/gallium/drivers/llvmpipe/lp_state_fs.c:3434 #23 0x00007ffff6ae78cf in llvmpipe_update_derived (llvmpipe=0x656510) at ../../../../../src/gallium/drivers/llvmpipe/lp_state_derived.c:210 #24 0x00007ffff6abf980 in llvmpipe_draw_vbo (pipe=0x656510, info=0x7fffffffdd10) at ../../../../../src/gallium/drivers/llvmpipe/lp_draw_arrays.c:70 #25 0x00007ffff696a6af in cso_draw_vbo (cso=0x83e070, info=0x7fffffffdd10) at ../../../../src/gallium/auxiliary/cso_cache/cso_context.c:1693 #26 0x00007ffff6724054 in st_draw_vbo (ctx=0x7fd9c0, prims=0x7fffffffdde0, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, max_index=3, tfb_vertcount=0x0, stream=0, indirect=0x0) at ../../../src/mesa/state_tracker/st_draw.c:227 #27 0x00007ffff66c43d4 in vbo_draw_arrays (ctx=0x7fd9c0, mode=5, start=0, count=4, numInstances=1, baseInstance=0, drawID=0) at ../../../src/mesa/vbo/vbo_exec_array.c:486 #28 0x00007ffff66c4be4 in vbo_exec_DrawArrays (mode=5, start=0, count=4) at ../../../src/mesa/vbo/vbo_exec_array.c:641 #29 0x00007ffff7b0da78 in piglit_draw_rect_from_arrays (verts=0x7fffffffdf00, tex=0x7fffffffdee0, use_patches=false, instance_count=1) at /home/brianp/pig/tests/util/piglit-util-gl.c:719 #30 0x00007ffff7b0e22e in piglit_draw_rect_tex (x=0, y=0, w=32, h=32, tx=0, ty=0, tw=1, th=1) at /home/brianp/pig/tests/util/piglit-util-gl.c:916 #31 0x0000000000403213 in run_factor_set (src_factor_rgb=776, src_factor_a=771, dst_factor_rgb=769, dst_factor_a=32769, op_rgb=32774, op_a=32774, constant_color=0x403c30 <constant_color>) at /home/brianp/pig/tests/spec/gl-1.0/blend.c:592 #32 0x0000000000403617 in proc_factors (sf=8, sfa=5, df=3, dfa=8, op=0, opa=0) at /home/brianp/pig/tests/spec/gl-1.0/blend.c:682 #33 0x000000000040386e in run_all_factor_sets () at /home/brianp/pig/tests/spec/gl-1.0/blend.c:798 #34 0x0000000000403930 in piglit_display () at /home/brianp/pig/tests/spec/gl-1.0/blend.c:822 #35 0x00007ffff7b3566c in process_next_event (x11_fw=0x62ebd0) at /home/brianp/pig/tests/util/piglit-framework-gl/piglit_x11_framework.c:137 #36 0x00007ffff7b3572c in enter_event_loop (winsys_fw=0x62ebd0) at /home/brianp/pig/tests/util/piglit-framework-gl/piglit_x11_framework.c:153 #37 0x00007ffff7b34cbd in run_test (gl_fw=0x62ebd0, argc=2, argv=0x7fffffffe3a8) at /home/brianp/pig/tests/util/piglit-framework-gl/piglit_winsys_framework.c:88 #38 0x00007ffff7b18f96 in piglit_gl_test_run (argc=2, argv=0x7fffffffe3a8, config=0x7fffffffe260) at /home/brianp/pig/tests/util/piglit-framework-gl.c:229 #39 0x00000000004016a6 in main (argc=2, argv=0x7fffffffe3a8) at /home/brianp/pig/tests/spec/gl-1.0/blend.c:87

test_number = 15740 at this point.

srcRGB = GL_SRC_ALPHA_SATURATE
srcA = GL_ONE_MINUS_SRC_ALPHA
dstRGB =  GL_ONE_MINUS_SRC_COLOR
dstA = GL_CONSTANT_COLOR
opRGB = GL_FUNC_ADD
opA = GL_FUNC_ADD


I'll have to test a newer version of LLVM tomorrow. Have you run gl-1.0-blend-func yourself, Roland?

-Brian


Either way,
for 1-2/3
Reviewed-by: Roland Scheidegger <srol...@vmware.com>

Am 17.01.2018 um 23:54 schrieb Brian Paul:
The test normally runs about 27,000 tests and takes quite a long time
with some drivers. With the --quick option, only 1% of the tests are run.

And update tests/quick.py to run the test with --quick.
---
  tests/quick.py            |  7 +++++++
  tests/spec/gl-1.0/blend.c | 23 ++++++++++++++++++-----
  2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/tests/quick.py b/tests/quick.py
index 53774e4..73c4678 100644
--- a/tests/quick.py
+++ b/tests/quick.py
@@ -68,6 +68,13 @@ with profile.test_list.group_manager(
      with profile.test_list.allow_reassignment:
          g(['ext_texture_env_combine-combine', '--quick'], 
'texture-env-combine')
+# Set the --quick flag on the gl-1.0 blending test
+with profile.test_list.group_manager(
+        PiglitGLTest,
+        grouptools.join('spec', '!opengl 1.0')) as g:
+    with profile.test_list.allow_reassignment:
+        g(['gl-1.0-blend-func', '--quick'], 'gl-1.0-blend-func')
+
  # Limit texture size to 512x512 for some texture_multisample tests.
  # The default (max supported size) can be pretty slow.
  with profile.test_list.group_manager(
diff --git a/tests/spec/gl-1.0/blend.c b/tests/spec/gl-1.0/blend.c
index 769339f..192b271 100644
--- a/tests/spec/gl-1.0/blend.c
+++ b/tests/spec/gl-1.0/blend.c
@@ -64,6 +64,8 @@
#define HUGE_STEP 1000 +static int test_stride = 1;
+
  /*
   * We will check each pair of blend factors
   * for each pixel in a square image of this
@@ -187,6 +189,13 @@ piglit_init(int argc, char **argv)
        const char* blend_rgb_tol = getenv("PIGLIT_BLEND_RGB_TOLERANCE");
        const char* blend_alpha_tol = getenv("PIGLIT_BLEND_ALPHA_TOLERANCE");
+ if (argc > 1 && strcmp(argv[1], "--quick") == 0) {
+               /* By default we run 27552 tests which is time consuming.
+                * With --quick we run only 1% of the tests.
+                */
+               test_stride = 100;
+       }
+
        /*
         * Hack: Make driver tests on incorrect hardware feasible
         * We want to be able to perform meaningful tests
@@ -687,6 +696,7 @@ run_all_factor_sets(void)
        bool pass = true;
        int gl_version = piglit_get_gl_version();
        int counter = 0; /* Number of tests we have done. */
+       int test_number = 0;
        int step;
        int op, opa;
        int sf, sfa, df, dfa;
@@ -784,11 +794,14 @@ run_all_factor_sets(void)
                                                for (dfa = 0; dfa <
                                                     num_dst_factors_sep;
                                                     dfa += step) {
-                                                       pass &= proc_factors(
-                                                               sf, sfa,
-                                                               df, dfa,
-                                                               op, opa);
-                                                       counter++;
+                                                       if (test_number % 
test_stride == 0) {
+                                                               pass &= 
proc_factors(
+                                                                       sf, sfa,
+                                                                       df, dfa,
+                                                                       op, 
opa);
+                                                               counter++;
+                                                       }
+                                                       test_number++;
                                                }
                                        }
                                }



_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to