Skip to content

Commit 63c9d35

Browse files
committed
test: extra: enable valgrind (and coverage) for forcer tests
Add two more easier forcer tests for valgrind, the larger tests take too long
1 parent d1a18f3 commit 63c9d35

File tree

1 file changed

+218
-1
lines changed

1 file changed

+218
-1
lines changed

check/extra/forcer.frm

Lines changed: 218 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ L F =
1919
B ep;
2020
P;
2121
.end
22-
#pend_if valgrind?
2322
assert succeeded?
2423
assert result("F") =~ expr("
2524
+ ep^-3 * ( 1/24 )
@@ -141,6 +140,7 @@ ModuleOption noparallel;
141140
B ep;
142141
P;
143142
.end
143+
# Too slow, but is supposed to pass.
144144
#pend_if valgrind?
145145
assert succeeded?
146146
assert result("F1") =~ expr("
@@ -269,6 +269,7 @@ ModuleOption noparallel;
269269
B ep;
270270
P;
271271
.end
272+
# Too slow, but is supposed to pass.
272273
#pend_if valgrind?
273274
assert succeeded?
274275
assert result("F1") =~ expr("
@@ -289,3 +290,219 @@ assert result("F2") =~ expr("
289290
z3 - 3705/8*z3^2
290291
")
291292
*--#] Forcer_1-expand :
293+
*--#[ Forcer_2 :
294+
* An easier version of the above, for checking with valgrind
295+
* timeout = 60 seconds.
296+
#include- forcer.h
297+
CF f,f1,f2,f3;
298+
V p2,p3;
299+
S x3;
300+
301+
* Give 1 or -1. n1 is not used.
302+
Table randomsign(n1?);
303+
Fill randomsign() = random_(2)*2-3;
304+
305+
* Zip two functions as:
306+
* zip(f1,f2(p1,...,pN),f3(q1,...,qN)) -> f1(p1,q1,...,pN,qN),
307+
* for N >= 1.
308+
Table zip(f1?(?a1),f2?(p2?,?a2),f3?(p3?,?a3));
309+
Fill zip() =
310+
+ thetap_(nargs_(?a2,?a3)) * zip(f1(?a1,p2,p3),f2(?a2),f3(?a3))
311+
+ delta_(nargs_(?a2,?a3)) * f1(?a1,p2,p3)
312+
;
313+
314+
* Element-wise multiplication as:
315+
* emul(f1,f2(p1,...,pN),f3(a1,...,aN)) -> f1(p1*a1,...,pN*aN)
316+
* for N >= 1.
317+
Table emul(f1?(?a1),f2?(p2?,?a2),f3?(x3?,?a3));
318+
Fill emul() =
319+
+ thetap_(nargs_(?a2,?a3)) * emul(f1(?a1,p2*x3),f2(?a2),f3(?a3))
320+
+ delta_(nargs_(?a2,?a3)) * f1(?a1,p2*x3)
321+
;
322+
323+
L F1 =
324+
#do i=1,2
325+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,0,0,0)
326+
#enddo
327+
;
328+
329+
L F2 =
330+
#do i=1,2
331+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,-1,0,0)
332+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,0,-1,0)
333+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,0,0,-1)
334+
#enddo
335+
;
336+
337+
id Zno1(n1?,...,n14?) =
338+
+vx(-Q,p4,p5)
339+
*vx(p3,-p4,p10)
340+
*vx(p2,-p3,p9)
341+
*vx(p1,-p2,p11)
342+
*vx(-p5,p6,-p11)
343+
*vx(-p6,p7,-p10)
344+
*vx(-p7,p8,-p9)
345+
*vx(-p1,-p8,Q)
346+
/<p1.p1^n1>/.../<p11.p11^n11>
347+
/p2.p4^n12/Q.p2^n13/Q.p3^n14
348+
;
349+
350+
id Zno2(n1?,...,n14?) =
351+
+vx(-Q,p4,p5)
352+
*vx(p3,-p4,p11)
353+
*vx(p6,p7,p10)
354+
*vx(p2,-p3,-p10)
355+
*vx(p1,-p2,p9)
356+
*vx(-p5,-p6,-p9)
357+
*vx(-p7,p8,-p11)
358+
*vx(-p1,-p8,Q)
359+
/<p1.p1^n1>/.../<p11.p11^n11>
360+
/Q.p2^n12/p1.p4^n13/Q.p3^n14
361+
;
362+
363+
id Zno3(n1?,...,n14?) =
364+
+vx(-Q,p3,p4)
365+
*vx(p6,p8,p10)
366+
*vx(p5,-p10,p11)
367+
*vx(p1,-p3,-p5)
368+
*vx(-p4,-p8,p9)
369+
*vx(p7,-p9,-p11)
370+
*vx(p2,-p6,-p7)
371+
*vx(-p1,-p2,Q)
372+
/<p1.p1^n1>/.../<p11.p11^n11>
373+
/Q.p6^n12/Q.p8^n13/p3.p6^n14
374+
;
375+
376+
* Make a random permutation of the loop momenta. The result should be the same.
377+
multiply f1(p1,...,p11);
378+
multiply ranperm_(f2,p1,...,p11);
379+
multiply f3(<randomsign(1)>,...,<randomsign(11)>);
380+
id f2(?a)*f3(?b) = emul(f2,f2(?a),f3(?b));
381+
id f1(?a)*f2(?b) = zip(f1,f1(?a),f2(?b));
382+
id f1(?a) = replace_(?a);
383+
384+
ModuleOption noparallel;
385+
.sort:input;
386+
387+
#call Forcer(msbarexpand=4)
388+
B ep;
389+
P;
390+
.end
391+
assert succeeded?
392+
assert result("F1") =~ expr("
393+
+ ep^-1 * ( - 15*z5 )
394+
395+
+ 21/2*z7 - 75/2*z6 + 55*z5 - 51*z3^2
396+
")
397+
assert result("F2") =~ expr("
398+
+ 161/2*z7 + 20*z5 + 18*z3^2
399+
")
400+
*--#] Forcer_2 :
401+
*--#[ Forcer_2-expand :
402+
* An easier version of the above, for checking with valgrind
403+
* timeout = 60 seconds.
404+
#include- forcer.h
405+
CF f,f1,f2,f3;
406+
V p2,p3;
407+
S x3;
408+
409+
* Give 1 or -1. n1 is not used.
410+
Table randomsign(n1?);
411+
Fill randomsign() = random_(2)*2-3;
412+
413+
* Zip two functions as:
414+
* zip(f1,f2(p1,...,pN),f3(q1,...,qN)) -> f1(p1,q1,...,pN,qN),
415+
* for N >= 1.
416+
Table zip(f1?(?a1),f2?(p2?,?a2),f3?(p3?,?a3));
417+
Fill zip() =
418+
+ thetap_(nargs_(?a2,?a3)) * zip(f1(?a1,p2,p3),f2(?a2),f3(?a3))
419+
+ delta_(nargs_(?a2,?a3)) * f1(?a1,p2,p3)
420+
;
421+
422+
* Element-wise multiplication as:
423+
* emul(f1,f2(p1,...,pN),f3(a1,...,aN)) -> f1(p1*a1,...,pN*aN)
424+
* for N >= 1.
425+
Table emul(f1?(?a1),f2?(p2?,?a2),f3?(x3?,?a3));
426+
Fill emul() =
427+
+ thetap_(nargs_(?a2,?a3)) * emul(f1(?a1,p2*x3),f2(?a2),f3(?a3))
428+
+ delta_(nargs_(?a2,?a3)) * f1(?a1,p2*x3)
429+
;
430+
431+
L F1 =
432+
#do i=1,2
433+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,0,0,0)
434+
#enddo
435+
;
436+
437+
L F2 =
438+
#do i=1,2
439+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,-1,0,0)
440+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,0,-1,0)
441+
+ Zno`i'(1,1,1,1,1,1,1,1,1,1,1,0,0,-1)
442+
#enddo
443+
;
444+
445+
id Zno1(n1?,...,n14?) =
446+
+vx(-Q,p4,p5)
447+
*vx(p3,-p4,p10)
448+
*vx(p2,-p3,p9)
449+
*vx(p1,-p2,p11)
450+
*vx(-p5,p6,-p11)
451+
*vx(-p6,p7,-p10)
452+
*vx(-p7,p8,-p9)
453+
*vx(-p1,-p8,Q)
454+
/<p1.p1^n1>/.../<p11.p11^n11>
455+
/p2.p4^n12/Q.p2^n13/Q.p3^n14
456+
;
457+
458+
id Zno2(n1?,...,n14?) =
459+
+vx(-Q,p4,p5)
460+
*vx(p3,-p4,p11)
461+
*vx(p6,p7,p10)
462+
*vx(p2,-p3,-p10)
463+
*vx(p1,-p2,p9)
464+
*vx(-p5,-p6,-p9)
465+
*vx(-p7,p8,-p11)
466+
*vx(-p1,-p8,Q)
467+
/<p1.p1^n1>/.../<p11.p11^n11>
468+
/Q.p2^n12/p1.p4^n13/Q.p3^n14
469+
;
470+
471+
id Zno3(n1?,...,n14?) =
472+
+vx(-Q,p3,p4)
473+
*vx(p6,p8,p10)
474+
*vx(p5,-p10,p11)
475+
*vx(p1,-p3,-p5)
476+
*vx(-p4,-p8,p9)
477+
*vx(p7,-p9,-p11)
478+
*vx(p2,-p6,-p7)
479+
*vx(-p1,-p2,Q)
480+
/<p1.p1^n1>/.../<p11.p11^n11>
481+
/Q.p6^n12/Q.p8^n13/p3.p6^n14
482+
;
483+
484+
* Make a random permutation of the loop momenta. The result should be the same.
485+
multiply f1(p1,...,p11);
486+
multiply ranperm_(f2,p1,...,p11);
487+
multiply f3(<randomsign(1)>,...,<randomsign(11)>);
488+
id f2(?a)*f3(?b) = emul(f2,f2(?a),f3(?b));
489+
id f1(?a)*f2(?b) = zip(f1,f1(?a),f2(?b));
490+
id f1(?a) = replace_(?a);
491+
492+
ModuleOption noparallel;
493+
.sort:input;
494+
495+
#call Forcer(msbarexpand=4,polyratfunexpand=15)
496+
B ep;
497+
P;
498+
.end
499+
assert succeeded?
500+
assert result("F1") =~ expr("
501+
+ ep^-1 * ( - 15*z5 )
502+
503+
+ 21/2*z7 - 75/2*z6 + 55*z5 - 51*z3^2
504+
")
505+
assert result("F2") =~ expr("
506+
+ 161/2*z7 + 20*z5 + 18*z3^2
507+
")
508+
*--#] Forcer_2-expand :

0 commit comments

Comments
 (0)