44 auto isStartNode = [](
Node& n){
return isStart(n); };
45 auto isInnerNode = [](
Node& n){
return isInner(n); };
46 auto isExitNode = [](
Node& n){
return isExit(n); };
98 CHECK (testLoad.getHash() == 0x554F5086DE5B0861);
105 testLoad.setupSchedule(scheduler)
109 CHECK (testLoad.getHash() == 0x554F5086DE5B0861);
120 CHECK (n0.hash == 0);
121 CHECK (n0.level == 0);
122 CHECK (n0.weight == 0);
123 CHECK (n0.pred.size() == 0 );
124 CHECK (n0.succ.size() == 0 );
125 CHECK (n0.pred == Node::Tab{0});
126 CHECK (n0.succ == Node::Tab{0});
129 CHECK (n1.hash == 23);
130 CHECK (n2.hash == 55);
132 CHECK (0 == n0.calculate());
133 CHECK (0 == n0.hash);
134 CHECK (23 == n1.calculate());
135 CHECK (23 == n1.hash);
136 CHECK (55 == n2.calculate());
137 CHECK (55 == n2.hash);
140 CHECK (isSameObject (*n0.pred[0], n1));
141 CHECK (isSameObject (*n1.succ[0], n0));
142 CHECK (not n0.pred[1]);
143 CHECK (not n1.succ[1]);
144 CHECK (n2.pred == Node::Tab{0});
145 CHECK (n2.succ == Node::Tab{0});
148 CHECK (isSameObject (*n0.pred[0], n1));
149 CHECK (isSameObject (*n0.pred[1], n2));
150 CHECK (isSameObject (*n2.succ[0], n0));
151 CHECK (not n0.pred[2]);
152 CHECK (not n2.succ[1]);
154 CHECK (n0.hash == 0);
156 CHECK (n0.hash == 0x53F8F4753B85558A);
162 CHECK (n00.hash == 0);
164 CHECK (n00.hash == 0xECA6BE804934CAF2);
165 CHECK (n0.hash == 0x53F8F4753B85558A);
167 CHECK (isSameObject (*n1.succ[0], n0));
168 CHECK (isSameObject (*n1.succ[1], n00));
169 CHECK (isSameObject (*n2.succ[0], n0));
170 CHECK (isSameObject (*n2.succ[1], n00));
171 CHECK (isSameObject (*n00.pred[0], n2));
172 CHECK (isSameObject (*n00.pred[1], n1));
173 CHECK (isSameObject (*n0.pred[0], n1));
174 CHECK (isSameObject (*n0.pred[1], n2));
176 CHECK (n00.hash == 0xECA6BE804934CAF2);
178 CHECK (n00.hash == 0xB682F06D29B165C0);
180 CHECK (isnil (n0.succ));
181 CHECK (isnil (n00.succ));
182 CHECK (n00.succ.empty());
183 CHECK (0 == n00.succ.size());
184 CHECK (2 == n00.pred.size());
185 CHECK (2 == n0.pred.size());
186 CHECK (2 == n1.succ.size());
187 CHECK (2 == n2.succ.size());
188 CHECK (isnil (n1.pred));
189 CHECK (isnil (n2.pred));
207 CHECK (graph.topLevel() == 31);
208 CHECK (graph.getSeed() == 0);
209 CHECK (graph.getHash() == 0xB3445F1240A1B05F);
211 auto* node = & *graph.allNodes();
212 CHECK (node->hash == graph.getSeed());
213 CHECK (node->succ.size() == 1);
214 CHECK (isSameObject(*node, *node->succ[0]->pred[0]));
217 while (not isnil(node->succ))
220 node = node->succ[0];
221 CHECK (steps == node->level);
222 CHECK (1 == node->pred.size());
223 size_t exHash = node->hash;
228 CHECK (exHash == node->hash);
232 boost::hash_combine (node->hash, node->pred[0]->hash);
233 CHECK (exHash == node->hash);
237 CHECK (steps == graph.topLevel());
238 CHECK (node->hash == 0x5CDF544B70E59866);
242 size_t globalHash{0};
243 boost::hash_combine (globalHash, node->hash);
244 CHECK (globalHash == graph.getHash());
245 CHECK (globalHash == 0xB3445F1240A1B05F);
267 graph.expansionRule(graph.rule().probability(0.4).maxVal(2))
272 CHECK (graph.getHash() == 0x6EDD7B92F12E9A37);
274 auto stat = graph.computeGraphStatistics();
275 CHECK (stat.indicators[
STAT_NODE].cnt == 32);
276 CHECK (stat.levels == 11);
277 CHECK (stat.indicators[
STAT_FORK].cnt == 4);
278 CHECK (stat.indicators[
STAT_SEED].cnt == 1);
279 CHECK (stat.indicators[
STAT_EXIT].cnt == 1);
280 CHECK (stat.indicators[
STAT_NODE].pL ==
"2.9090909"_expect);
281 CHECK (stat.indicators[
STAT_NODE].cL ==
"0.640625"_expect);
286 graph.expansionRule(graph.rule().probability(0.4).maxVal(2).shuffle(23))
291 CHECK (graph.getHash() == 0x710D010554FEA614);
293 stat = graph.computeGraphStatistics();
294 CHECK (stat.levels == 7);
295 CHECK (stat.indicators[
STAT_NODE].pL ==
"4.5714286"_expect);
296 CHECK (stat.indicators[
STAT_FORK].cnt == 7);
297 CHECK (stat.indicators[
STAT_EXIT].cnt == 10);
298 CHECK (stat.indicators[
STAT_JOIN].cnt == 1);
299 CHECK (stat.indicators[
STAT_EXIT].cL == 1);
300 CHECK (stat.indicators[
STAT_JOIN].cL == 1);
306 gra_2.expansionRule(gra_2.rule().probability(0.4).maxVal(2).shuffle(23))
311 CHECK (gra_2.getHash() == 0x619491B22C3F8A6F);
314 CHECK (stat.levels == 36);
315 CHECK (stat.indicators[
STAT_NODE].pL ==
"7.1111111"_expect);
316 CHECK (stat.indicators[
STAT_JOIN].pL ==
"0.77777778"_expect);
317 CHECK (stat.indicators[
STAT_FORK].frac ==
"0.24609375"_expect);
318 CHECK (stat.indicators[
STAT_JOIN].frac ==
"0.109375"_expect);
319 CHECK (stat.indicators[
STAT_EXIT].cnt == 3);
320 CHECK (stat.indicators[
STAT_EXIT].cL == 1);
339 graph.expansionRule(graph.rule_atStart(8))
340 .reductionRule(graph.rule().probability(0.2).maxVal(3).shuffle(555))
345 CHECK (graph.getHash() == 0x3E9BFAE5E686BEB4);
347 auto stat = graph.computeGraphStatistics();
348 CHECK (stat.levels == 8);
349 CHECK (stat.indicators[
STAT_JOIN].cnt == 4);
350 CHECK (stat.indicators[
STAT_FORK].cnt == 1);
351 CHECK (stat.indicators[
STAT_FORK].cL == 0.0);
352 CHECK (stat.indicators[
STAT_NODE].cL ==
"0.42857143"_expect);
356 graph.expansionRule(graph.rule().probability(0.2).maxVal(3).shuffle(555))
357 .reductionRule(graph.rule().probability(0.2).maxVal(3).shuffle(555))
362 CHECK (graph.getHash() == 0xB0335595D34F1D8D);
364 stat = graph.computeGraphStatistics();
365 CHECK (stat.levels == 11);
366 CHECK (stat.indicators[
STAT_NODE].pL ==
"2.9090909"_expect);
367 CHECK (stat.indicators[
STAT_FORK].cnt == 5);
368 CHECK (stat.indicators[
STAT_JOIN].cnt == 3);
369 CHECK (stat.indicators[
STAT_FORK].cL == 0.5);
370 CHECK (stat.indicators[
STAT_JOIN].cL ==
"0.73333333"_expect);
374 graph.expansionRule(graph.rule().probability(0.3).maxVal(4).shuffle(555))
375 .reductionRule(graph.rule().probability(0.9).maxVal(2).shuffle(555))
380 CHECK (graph.getHash() == 0x220A2E81F65146FC);
382 stat = graph.computeGraphStatistics();
383 CHECK (stat.levels == 12);
384 CHECK (stat.indicators[
STAT_NODE].pL ==
"2.6666667"_expect);
385 CHECK (stat.indicators[
STAT_FORK].cnt == 7);
386 CHECK (stat.indicators[
STAT_JOIN].cnt == 9);
387 CHECK (stat.indicators[
STAT_FORK].cL ==
"0.41558442"_expect);
388 CHECK (stat.indicators[
STAT_JOIN].cL ==
"0.62626263"_expect);
389 CHECK (stat.indicators[
STAT_FORK].pLW ==
"0.19583333"_expect);
390 CHECK (stat.indicators[
STAT_JOIN].pLW ==
"0.26527778"_expect);
408 graph.seedingRule(graph.rule().probability(0.2).maxVal(3).shuffle())
413 CHECK (graph.getHash() == 0xBC35A96B3CE1F39F);
415 auto stat = graph.computeGraphStatistics();
416 CHECK (stat.levels == 7);
417 CHECK (stat.indicators[
STAT_SEED].cnt == 12);
418 CHECK (stat.indicators[
STAT_FORK].cnt == 0);
419 CHECK (stat.indicators[
STAT_LINK].cnt == 14);
420 CHECK (stat.indicators[
STAT_LINK].pL == 2);
421 CHECK (stat.indicators[
STAT_NODE].pL ==
"4.5714286"_expect);
422 CHECK (stat.indicators[
STAT_NODE].cL ==
"0.734375"_expect);
423 CHECK (stat.indicators[
STAT_LINK].cL ==
"0.64285714"_expect);
424 CHECK (stat.indicators[
STAT_JOIN].cL == 1);
429 graph.seedingRule(graph.rule().probability(0.2).maxVal(3).shuffle())
430 .reductionRule(graph.rule().probability(0.9).maxVal(2))
435 CHECK (graph.getHash() == 0x3DFA720156540247);
437 stat = graph.computeGraphStatistics();
438 CHECK (stat.indicators[
STAT_SEED].cnt == 11);
439 CHECK (stat.indicators[
STAT_JOIN].cnt == 6);
440 CHECK (stat.indicators[
STAT_LINK].cnt == 15);
441 CHECK (stat.indicators[
STAT_FORK].cnt == 0);
442 CHECK (stat.indicators[
STAT_NODE].pL == 3.2);
443 CHECK (stat.indicators[
STAT_NODE].cL ==
"0.5625"_expect);
444 CHECK (stat.indicators[
STAT_LINK].cL ==
"0.55555556"_expect);
445 CHECK (stat.indicators[
STAT_JOIN].cL ==
"0.72222222"_expect);
446 CHECK (stat.levels == 10);
465 graph.pruningRule(graph.rule().probability(0.2))
470 CHECK (graph.getHash() == 0x660BD1CD261A990);
472 auto stat = graph.computeGraphStatistics();
473 CHECK (stat.levels == 32);
474 CHECK (stat.segments == 8);
475 CHECK (stat.indicators[
STAT_NODE].pS == 4);
476 CHECK (stat.indicators[
STAT_NODE].pL == 1);
477 CHECK (stat.indicators[
STAT_SEED].cnt == 8);
478 CHECK (stat.indicators[
STAT_EXIT].cnt == 8);
479 CHECK (stat.indicators[
STAT_LINK].cnt == 16);
483 graph.pruningRule(graph.rule().probability(0.2))
484 .expansionRule(graph.rule().probability(0.6))
490 CHECK (graph.getHash() == 0x1D0A7C39647340AA);
492 stat = graph.computeGraphStatistics();
493 CHECK (stat.levels == 14);
494 CHECK (stat.segments == 5);
495 CHECK (stat.indicators[
STAT_NODE].pS ==
"6.4"_expect);
496 CHECK (stat.indicators[
STAT_FORK].sL ==
"0"_expect);
497 CHECK (stat.indicators[
STAT_EXIT].sL ==
"1"_expect);
498 CHECK (stat.indicators[
STAT_EXIT].pS ==
"3"_expect);
499 CHECK (stat.indicators[
STAT_SEED].cnt == 5);
500 CHECK (stat.indicators[
STAT_FORK].cnt == 5);
501 CHECK (stat.indicators[
STAT_EXIT].cnt == 15);
502 CHECK (stat.indicators[
STAT_LINK].cnt == 12);
503 CHECK (stat.indicators[
STAT_NODE].pL ==
"2.2857143"_expect);
507 graph.pruningRule(graph.rule().probability(0.2).shuffle(5))
508 .expansionRule(graph.rule().probability(0.6))
514 CHECK (graph.getHash() == 0x12BB22F76ECC5C1B);
516 stat = graph.computeGraphStatistics();
517 CHECK (stat.segments == 1);
518 CHECK (stat.indicators[
STAT_FORK].cnt == 3);
519 CHECK (stat.indicators[
STAT_EXIT].cnt == 10);
520 CHECK (stat.indicators[
STAT_EXIT].pL ==
"1.6666667"_expect);
521 CHECK (stat.indicators[
STAT_NODE].pL ==
"5.3333333"_expect);
524 graph.expansionRule(graph.rule());
530 graph.seedingRule(graph.rule_atStart(1))
531 .pruningRule(graph.rule().probability(0.2))
537 CHECK (graph.getHash() == 0xBFFA04FE8202C708);
541 stat = graph.computeGraphStatistics();
542 CHECK (stat.levels == 12);
543 CHECK (stat.segments == 1);
544 CHECK (stat.indicators[
STAT_SEED].cnt == 12);
545 CHECK (stat.indicators[
STAT_EXIT].cnt == 11);
546 CHECK (stat.indicators[
STAT_LINK].cnt == 10);
547 CHECK (stat.indicators[
STAT_JOIN].cnt == 1);
548 CHECK (stat.indicators[
STAT_JOIN].cL ==
"1"_expect);
549 CHECK (stat.indicators[
STAT_NODE].pL ==
"2.6666667"_expect);
550 CHECK (stat.indicators[
STAT_NODE].cL ==
"0.52840909"_expect);
551 CHECK (stat.indicators[
STAT_SEED].cL ==
"0.5"_expect);
552 CHECK (stat.indicators[
STAT_EXIT].cL ==
"0.62809917"_expect);
559 graph.seedingRule(graph.rule().fixedVal(1))
560 .pruningRule(graph.rule().probability(0.5))
561 .reductionRule(graph.rule().probability(0.8).maxVal(4))
567 CHECK (graph.getHash() == 0xFB0A0EA9B7072507);
569 stat = graph.computeGraphStatistics();
570 CHECK (stat.levels == 8);
571 CHECK (stat.indicators[
STAT_JOIN].pL == 1);
572 CHECK (stat.indicators[
STAT_SEED].cnt == 22);
573 CHECK (stat.indicators[
STAT_SEED].pL == 2.75);
606 graph.seedingRule(graph.rule_atLink(1))
607 .pruningRule(graph.rule().probability(0.4))
608 .reductionRule(graph.rule().probability(0.6).maxVal(5).minVal(2))
614 CHECK (graph.getHash() == 0x6B5D7BD3130044E2);
616 auto stat = graph.computeGraphStatistics();
617 CHECK (stat.indicators[
STAT_NODE].cL ==
"0.50509511"_expect);
618 CHECK (stat.levels == 93);
619 CHECK (stat.indicators[
STAT_NODE].pL ==
"2.7526882"_expect);
620 CHECK (stat.indicators[
STAT_SEED].pL ==
"1.0537634"_expect);
621 CHECK (stat.indicators[
STAT_JOIN].pL ==
"0.48387097"_expect);
622 CHECK (stat.indicators[
STAT_EXIT].pL ==
"0.34408602"_expect);
623 CHECK (stat.indicators[
STAT_SEED].frac ==
"0.3828125"_expect);
624 CHECK (stat.indicators[
STAT_EXIT].frac ==
"0.125"_expect);
625 CHECK (stat.indicators[
STAT_SEED].cLW ==
"0.49273514"_expect);
626 CHECK (stat.indicators[
STAT_LINK].cLW ==
"0.49588657"_expect);
627 CHECK (stat.indicators[
STAT_JOIN].cLW ==
"0.52481335"_expect);
628 CHECK (stat.indicators[
STAT_EXIT].cLW ==
"0.55716297"_expect);
635 graph.seedingRule(graph.rule_atLink(1))
636 .pruningRule(graph.rule().probability(0.5))
637 .reductionRule(graph.rule().probability(0.6).maxVal(5).minVal(2))
643 CHECK (graph.getHash() == 0x20122CF2A1F301D1);
645 stat = graph.computeGraphStatistics();
646 CHECK (stat.levels == 77);
647 CHECK (stat.indicators[
STAT_NODE].pL ==
"3.3246753"_expect);
648 CHECK (stat.indicators[
STAT_SEED].frac ==
"0.421875"_expect);
649 CHECK (stat.indicators[
STAT_EXIT].frac ==
"0.14453125"_expect);
660 graph.seedingRule(graph.rule().probability(0.6).maxVal(1))
661 .reductionRule(graph.rule().probability(0.75).maxVal(3))
662 .pruningRule(graph.rule_atJoin(1))
668 CHECK (graph.getHash() == 0xB58904674ED84031);
670 stat = graph.computeGraphStatistics();
671 CHECK (stat.levels == 104);
672 CHECK (stat.indicators[
STAT_NODE].pL ==
"2.4615385"_expect);
673 CHECK (stat.indicators[
STAT_SEED].frac ==
"0.40234375"_expect);
674 CHECK (stat.indicators[
STAT_EXIT].frac ==
"0.19921875"_expect);
675 CHECK (stat.indicators[
STAT_SEED].pL ==
"0.99038462"_expect);
676 CHECK (stat.indicators[
STAT_EXIT].pL ==
"0.49038462"_expect);
683 graph.seedingRule(graph.rule().probability(0.8).maxVal(1))
684 .reductionRule(graph.rule().probability(0.75).maxVal(3))
685 .pruningRule(graph.rule_atJoin(1))
691 CHECK (graph.getHash() == 0x11B57D9E98FDF6DF);
693 stat = graph.computeGraphStatistics();
694 CHECK (stat.levels == 55);
695 CHECK (stat.indicators[
STAT_NODE].pL ==
"4.6545455"_expect);
696 CHECK (stat.indicators[
STAT_SEED].frac ==
"0.3984375"_expect);
697 CHECK (stat.indicators[
STAT_EXIT].frac ==
"0.1953125"_expect);
698 CHECK (stat.indicators[
STAT_SEED].pL ==
"1.8545455"_expect);
699 CHECK (stat.indicators[
STAT_EXIT].pL ==
"0.90909091"_expect);
704 graph.seedingRule(graph.rule().probability(0.8).maxVal(1))
705 .reductionRule(graph.rule().probability(0.75).maxVal(3).shuffle())
706 .pruningRule(graph.rule_atJoin(1))
712 CHECK (graph.getHash() == 0x7C0453E7A4F6418D);
714 stat = graph.computeGraphStatistics();
715 CHECK (stat.levels == 44);
716 CHECK (stat.indicators[
STAT_NODE].pL ==
"5.8181818"_expect);
717 CHECK (stat.indicators[
STAT_SEED].pL ==
"2.4318182"_expect);
718 CHECK (stat.indicators[
STAT_LINK].pL ==
"2.4772727"_expect);
719 CHECK (stat.indicators[
STAT_EXIT].pL ==
"1"_expect);
729 graph.seedingRule(graph.rule().probability(0.8).maxVal(1))
730 .reductionRule(graph.rule().probability(0.75).maxVal(3))
731 .pruningRule(graph.rule().probability(0.55))
737 CHECK (graph.getHash() == 0x904A906B7859301A);
739 stat = graph.computeGraphStatistics();
740 CHECK (stat.levels == 21);
741 CHECK (stat.indicators[
STAT_NODE].pL ==
"12.190476"_expect);
742 CHECK (stat.indicators[
STAT_SEED].pL ==
"6.8571429"_expect);
743 CHECK (stat.indicators[
STAT_LINK].pL ==
"2.3809524"_expect);
744 CHECK (stat.indicators[
STAT_JOIN].pL ==
"2.8095238"_expect);
745 CHECK (stat.indicators[
STAT_EXIT].pL ==
"2.5714286"_expect);
746 CHECK (stat.indicators[
STAT_SEED].frac ==
"0.5625"_expect );
747 CHECK (stat.indicators[
STAT_EXIT].frac ==
"0.2109375"_expect);
753 graph.seedingRule(graph.rule().probability(0.8).maxVal(1))
754 .reductionRule(graph.rule().probability(0.6).maxVal(5).minVal(2))
755 .pruningRule(graph.rule().probability(0.4))
761 CHECK (graph.getHash() == 0x9453C56534FF9CD6);
763 stat = graph.computeGraphStatistics();
764 CHECK (stat.levels == 26);
765 CHECK (stat.indicators[
STAT_NODE].pL ==
"9.8461538"_expect);
766 CHECK (stat.indicators[
STAT_SEED].frac ==
"0.40234375"_expect);
767 CHECK (stat.indicators[
STAT_LINK].frac ==
"0.453125"_expect);
768 CHECK (stat.indicators[
STAT_JOIN].frac ==
"0.109375"_expect );
769 CHECK (stat.indicators[
STAT_EXIT].frac ==
"0.08984375"_expect);
774 graph.seedingRule(graph.rule().probability(0.8).maxVal(2))
775 .reductionRule(graph.rule().probability(0.6).maxVal(5).minVal(2))
776 .pruningRule(graph.rule().probability(0.42))
782 CHECK (graph.getHash() == 0xA57727C2ED277C87);
784 stat = graph.computeGraphStatistics();
785 CHECK (stat.levels == 129);
786 CHECK (stat.indicators[
STAT_NODE].pL ==
"1.9844961"_expect);
787 CHECK (stat.indicators[
STAT_SEED].frac ==
"0.3359375"_expect);
788 CHECK (stat.indicators[
STAT_LINK].frac ==
"0.4140625"_expect);
789 CHECK (stat.indicators[
STAT_JOIN].frac ==
"0.1640625"_expect);
790 CHECK (stat.indicators[
STAT_EXIT].frac ==
"0.171875"_expect);
795 graph.seedingRule(graph.rule().probability(0.8).maxVal(2).shuffle())
796 .reductionRule(graph.rule().probability(0.6).maxVal(5).minVal(2))
797 .pruningRule(graph.rule().probability(0.42))
803 CHECK (graph.getHash() == 0x4D0575F8BD269FC3);
805 stat = graph.computeGraphStatistics();
806 CHECK (stat.levels == 20);
807 CHECK (stat.indicators[
STAT_NODE].pL ==
"12.8"_expect);
808 CHECK (stat.indicators[
STAT_SEED].pL ==
"7.65"_expect);
809 CHECK (stat.indicators[
STAT_LINK].pL ==
"3.15"_expect);
810 CHECK (stat.indicators[
STAT_JOIN].pL ==
"1.9"_expect);
811 CHECK (stat.indicators[
STAT_EXIT].pL ==
"0.95"_expect);
826 graph.expansionRule(graph.rule().probability(0.27).maxVal(4))
827 .reductionRule(graph.rule().probability(0.44).maxVal(6).minVal(2))
828 .seedingRule(graph.rule())
829 .pruningRule(graph.rule())
835 CHECK (graph.getHash() == 0x25114F8770B1B78E);
837 stat = graph.computeGraphStatistics();
838 CHECK (stat.levels == 30);
839 CHECK (stat.indicators[
STAT_SEED].cnt == 1);
840 CHECK (stat.indicators[
STAT_EXIT].cnt == 4);
841 CHECK (stat.indicators[
STAT_NODE].pL ==
"8.5333333"_expect);
842 CHECK (stat.indicators[
STAT_FORK].frac ==
"0.16015625"_expect);
843 CHECK (stat.indicators[
STAT_LINK].frac ==
"0.76171875"_expect);
844 CHECK (stat.indicators[
STAT_JOIN].frac ==
"0.1015625"_expect);
845 CHECK (stat.indicators[
STAT_KNOT].frac ==
"0.0390625"_expect);
846 CHECK (stat.indicators[
STAT_FORK].cLW ==
"0.43298744"_expect);
847 CHECK (stat.indicators[
STAT_JOIN].cLW ==
"0.64466378"_expect);
863 CHECK (cpuLoad.timeBase == 100us);
865 double micros = cpuLoad.
invoke();
866 CHECK (micros < 2000);
871 micros = cpuLoad.
invoke();
872 CHECK (micros < 133);
876 CHECK (micros < 110);
879 cpuLoad.useAllocation =
true;
880 micros = cpuLoad.
invoke();
881 CHECK (micros < 133);
885 CHECK (micros < 110);
888 cpuLoad.timeBase = 1ms;
889 cpuLoad.sizeBase *= 100;
892 cpuLoad.useAllocation =
false;
893 micros = cpuLoad.
invoke();
894 CHECK (micros > 900);
895 micros = cpuLoad.
invoke(5);
896 CHECK (micros > 4600);
897 micros = cpuLoad.
invoke(10);
898 CHECK (micros > 9500);
899 micros = cpuLoad.
invoke(100);
900 CHECK (micros > 95000);
902 cpuLoad.useAllocation =
true;
903 micros = cpuLoad.
invoke();
904 CHECK (micros > 900);
905 micros = cpuLoad.
invoke(5);
906 CHECK (micros > 4600);
907 micros = cpuLoad.
invoke(10);
908 CHECK (micros > 9500);
909 micros = cpuLoad.
invoke(100);
910 CHECK (micros > 95000);
927 graph.expansionRule(graph.rule().probability(0.8).maxVal(1))
928 .pruningRule(graph.rule().probability(0.6))
929 .weightRule((graph.rule().probability(0.5)))
932 CHECK (8 == graph.allNodes().filter(isStartNode).count());
933 CHECK (16 == graph.allNodes().filter(isExitNode).count());
937 auto exitHashes = graph.allNodes()
939 .transform([](Node& n){
return n.hash; })
941 CHECK (16 == exitHashes.size());
943 size_t combinedHash{0};
944 for (uint i=0; i <16; ++i)
945 boost::hash_combine (combinedHash, exitHashes[i]);
947 CHECK (graph.getHash() == combinedHash);
948 CHECK (graph.getHash() == 0x33B00C450215EB00);
952 graph.allNodePtr().grouped<4>()
953 .
foreach([&](
auto group)
956 auto& [a,b,c,d] = *group;
959 CHECK (not a->weight);
960 CHECK (not b->weight);
963 CHECK (c->hash == 0xAEDC04CFA2E5B999);
964 CHECK (d->hash == 0xAEDC04CFA2E5B999);
965 CHECK (c->weight == 4);
966 CHECK (d->weight == 4);
970 graph.setSeed(55).clearNodeHashes();
971 CHECK (graph.getSeed() == 55);
972 CHECK (graph.getHash() == 0);
973 graph.allNodePtr().grouped<4>()
974 .
foreach([&](
auto group)
976 auto& [a,b,c,d] = *group;
977 CHECK (a->hash == 55);
978 CHECK (b->hash == 0);
979 CHECK (b->hash == 0);
980 CHECK (b->hash == 0);
984 CHECK (graph.getHash() == 0x17427F67DBC8BCC0);
985 graph.allNodePtr().grouped<4>()
986 .
foreach([&](
auto group)
989 auto& [a,b,c,d] = *group;
990 CHECK (a->hash == 55);
991 CHECK (c->hash == 0x7887993B0ED41395);
992 CHECK (d->hash == 0x7887993B0ED41395);
996 graph.setSeed(0).recalculate();
997 CHECK (graph.getHash() == 0x33B00C450215EB00);
998 graph.setSeed(55).recalculate();
999 CHECK (graph.getHash() == 0x17427F67DBC8BCC0);
1027 auto isWithin10Percent = [](
double t,
double r)
1029 auto delta = abs (1.0 - t/r);
1035 CHECK (isWithin10Percent(t1, 6400));
1036 CHECK (isWithin10Percent(t2, 10*t1));
1037 CHECK (isWithin10Percent(t3, 4*t1));
1046 CHECK (graph.getHash() == 0x554F5086DE5B0861);
1049 CHECK (graph.getHash() == 0);
1053 CHECK (graph.getHash() == 0x554F5086DE5B0861);
1056 CHECK (graph.getHash() == 0);
1059 CHECK (graph.getHash() == 0x554F5086DE5B0861);
1081 CHECK (level.size() == 26);
1084 auto node = testLoad.allNodePtr().effuse();
1085 _Fmt nodeFmt{
"i=%-2d lev:%-2d w=%1d"};
1086 _Fmt levelFmt{
" Σ%-2d Σw:%2d"};
1087 auto nodeStr = [&](uint i)
1089 size_t l = node[i]->level;
1090 return string{nodeFmt % i % node[i]->level % node[i]->weight}
1091 + (i == level[l].endidx?
string{levelFmt % level[l].nodes % level[l].weight}
1095 CHECK (nodeStr( 1) ==
"i=1 lev:1 w=0 Σ1 Σw: 0"_expect);
1096 CHECK (nodeStr( 2) ==
"i=2 lev:2 w=2 Σ1 Σw: 2"_expect);
1097 CHECK (nodeStr( 3) ==
"i=3 lev:3 w=0 Σ1 Σw: 0"_expect);
1098 CHECK (nodeStr( 4) ==
"i=4 lev:4 w=0 Σ1 Σw: 0"_expect);
1099 CHECK (nodeStr( 5) ==
"i=5 lev:5 w=0 Σ1 Σw: 0"_expect);
1100 CHECK (nodeStr( 6) ==
"i=6 lev:6 w=1 Σ1 Σw: 1"_expect);
1101 CHECK (nodeStr( 7) ==
"i=7 lev:7 w=2 Σ1 Σw: 2"_expect);
1102 CHECK (nodeStr( 8) ==
"i=8 lev:8 w=2 Σ1 Σw: 2"_expect);
1103 CHECK (nodeStr( 9) ==
"i=9 lev:9 w=1 · · "_expect);
1104 CHECK (nodeStr(10) ==
"i=10 lev:9 w=1 Σ2 Σw: 2"_expect);
1105 CHECK (nodeStr(11) ==
"i=11 lev:10 w=0 · · "_expect);
1106 CHECK (nodeStr(12) ==
"i=12 lev:10 w=0 Σ2 Σw: 0"_expect);
1107 CHECK (nodeStr(13) ==
"i=13 lev:11 w=0 · · "_expect);
1108 CHECK (nodeStr(14) ==
"i=14 lev:11 w=0 Σ2 Σw: 0"_expect);
1109 CHECK (nodeStr(15) ==
"i=15 lev:12 w=1 · · "_expect);
1110 CHECK (nodeStr(16) ==
"i=16 lev:12 w=1 Σ2 Σw: 2"_expect);
1111 CHECK (nodeStr(17) ==
"i=17 lev:13 w=1 · · "_expect);
1112 CHECK (nodeStr(18) ==
"i=18 lev:13 w=1 Σ2 Σw: 2"_expect);
1113 CHECK (nodeStr(19) ==
"i=19 lev:14 w=2 · · "_expect);
1114 CHECK (nodeStr(20) ==
"i=20 lev:14 w=2 Σ2 Σw: 4"_expect);
1115 CHECK (nodeStr(21) ==
"i=21 lev:15 w=0 Σ1 Σw: 0"_expect);
1116 CHECK (nodeStr(22) ==
"i=22 lev:16 w=1 Σ1 Σw: 1"_expect);
1117 CHECK (nodeStr(23) ==
"i=23 lev:17 w=3 Σ1 Σw: 3"_expect);
1118 CHECK (nodeStr(24) ==
"i=24 lev:18 w=0 · · "_expect);
1119 CHECK (nodeStr(25) ==
"i=25 lev:18 w=0 · · "_expect);
1120 CHECK (nodeStr(26) ==
"i=26 lev:18 w=0 · · "_expect);
1121 CHECK (nodeStr(27) ==
"i=27 lev:18 w=0 · · "_expect);
1122 CHECK (nodeStr(28) ==
"i=28 lev:18 w=0 Σ5 Σw: 0"_expect);
1123 CHECK (nodeStr(29) ==
"i=29 lev:19 w=2 · · "_expect);
1124 CHECK (nodeStr(30) ==
"i=30 lev:19 w=2 · · "_expect);
1125 CHECK (nodeStr(31) ==
"i=31 lev:19 w=2 · · "_expect);
1126 CHECK (nodeStr(32) ==
"i=32 lev:19 w=2 · · "_expect);
1127 CHECK (nodeStr(33) ==
"i=33 lev:19 w=2 Σ5 Σw:10"_expect);
1128 CHECK (nodeStr(34) ==
"i=34 lev:20 w=3 · · "_expect);
1129 CHECK (nodeStr(35) ==
"i=35 lev:20 w=2 Σ2 Σw: 5"_expect);
1130 CHECK (nodeStr(36) ==
"i=36 lev:21 w=1 · · "_expect);
1131 CHECK (nodeStr(37) ==
"i=37 lev:21 w=1 · · "_expect);
1132 CHECK (nodeStr(38) ==
"i=38 lev:21 w=3 Σ3 Σw: 5"_expect);
1133 CHECK (nodeStr(39) ==
"i=39 lev:22 w=3 · · "_expect);
1134 CHECK (nodeStr(40) ==
"i=40 lev:22 w=3 · · "_expect);
1135 CHECK (nodeStr(41) ==
"i=41 lev:22 w=0 · · "_expect);
1136 CHECK (nodeStr(42) ==
"i=42 lev:22 w=0 · · "_expect);
1137 CHECK (nodeStr(43) ==
"i=43 lev:22 w=0 · · "_expect);
1138 CHECK (nodeStr(44) ==
"i=44 lev:22 w=0 Σ6 Σw: 6"_expect);
1139 CHECK (nodeStr(45) ==
"i=45 lev:23 w=0 · · "_expect);
1143 CHECK (level[19].nodes = 5);
1144 CHECK (level[19].weight = 10);
1153 uint concurrency = 4;
1154 auto steps = testLoad.levelScheduleSequence(concurrency).effuse();
1155 CHECK (steps.size() == 26);
1158 auto boost = [&](uint i){
return level[i].nodes / std::ceil (
double(level[i].nodes)/concurrency); };
1161 _Fmt stepFmt{
"lev:%-2d nodes:%-2d Σw:%2d %4.1f Δ%5.3f ▿▿ %6.3f"};
1162 auto stepStr = [&](uint i){
return string{stepFmt % i % level[i].nodes % level[i].weight % boost(i) % wfact(i) % steps[i]}; };
1165 CHECK (stepStr( 0) ==
"lev:0 nodes:1 Σw: 0 1.0 Δ0.000 ▿▿ 0.000"_expect);
1166 CHECK (stepStr( 1) ==
"lev:1 nodes:1 Σw: 0 1.0 Δ0.000 ▿▿ 0.000"_expect);
1167 CHECK (stepStr( 2) ==
"lev:2 nodes:1 Σw: 2 1.0 Δ2.000 ▿▿ 2.000"_expect);
1168 CHECK (stepStr( 3) ==
"lev:3 nodes:1 Σw: 0 1.0 Δ0.000 ▿▿ 2.000"_expect);
1169 CHECK (stepStr( 4) ==
"lev:4 nodes:1 Σw: 0 1.0 Δ0.000 ▿▿ 2.000"_expect);
1170 CHECK (stepStr( 5) ==
"lev:5 nodes:1 Σw: 0 1.0 Δ0.000 ▿▿ 2.000"_expect);
1171 CHECK (stepStr( 6) ==
"lev:6 nodes:1 Σw: 1 1.0 Δ1.000 ▿▿ 3.000"_expect);
1172 CHECK (stepStr( 7) ==
"lev:7 nodes:1 Σw: 2 1.0 Δ2.000 ▿▿ 5.000"_expect);
1173 CHECK (stepStr( 8) ==
"lev:8 nodes:1 Σw: 2 1.0 Δ2.000 ▿▿ 7.000"_expect);
1174 CHECK (stepStr( 9) ==
"lev:9 nodes:2 Σw: 2 2.0 Δ1.000 ▿▿ 8.000"_expect);
1175 CHECK (stepStr(10) ==
"lev:10 nodes:2 Σw: 0 2.0 Δ0.000 ▿▿ 8.000"_expect);
1176 CHECK (stepStr(11) ==
"lev:11 nodes:2 Σw: 0 2.0 Δ0.000 ▿▿ 8.000"_expect);
1177 CHECK (stepStr(12) ==
"lev:12 nodes:2 Σw: 2 2.0 Δ1.000 ▿▿ 9.000"_expect);
1178 CHECK (stepStr(13) ==
"lev:13 nodes:2 Σw: 2 2.0 Δ1.000 ▿▿ 10.000"_expect);
1179 CHECK (stepStr(14) ==
"lev:14 nodes:2 Σw: 4 2.0 Δ2.000 ▿▿ 12.000"_expect);
1180 CHECK (stepStr(15) ==
"lev:15 nodes:1 Σw: 0 1.0 Δ0.000 ▿▿ 12.000"_expect);
1181 CHECK (stepStr(16) ==
"lev:16 nodes:1 Σw: 1 1.0 Δ1.000 ▿▿ 13.000"_expect);
1182 CHECK (stepStr(17) ==
"lev:17 nodes:1 Σw: 3 1.0 Δ3.000 ▿▿ 16.000"_expect);
1183 CHECK (stepStr(18) ==
"lev:18 nodes:5 Σw: 0 2.5 Δ0.000 ▿▿ 16.000"_expect);
1184 CHECK (stepStr(19) ==
"lev:19 nodes:5 Σw:10 2.5 Δ4.000 ▿▿ 20.000"_expect);
1185 CHECK (stepStr(20) ==
"lev:20 nodes:2 Σw: 5 2.0 Δ2.500 ▿▿ 22.500"_expect);
1186 CHECK (stepStr(21) ==
"lev:21 nodes:3 Σw: 5 3.0 Δ1.667 ▿▿ 24.167"_expect);
1187 CHECK (stepStr(22) ==
"lev:22 nodes:6 Σw: 6 3.0 Δ2.000 ▿▿ 26.167"_expect);
1188 CHECK (stepStr(23) ==
"lev:23 nodes:6 Σw: 6 3.0 Δ2.000 ▿▿ 28.167"_expect);
1189 CHECK (stepStr(24) ==
"lev:24 nodes:10 Σw: 9 3.3 Δ2.700 ▿▿ 30.867"_expect);
1190 CHECK (stepStr(25) ==
"lev:25 nodes:3 Σw: 4 3.0 Δ1.333 ▿▿ 32.200"_expect);
1209 array<Node,4> nodes;
1210 auto& [s,p1,p2,e] = nodes;
1216 p1.level = p2.level = 1;
1218 CHECK (e.hash == 0);
1219 for (Node& n : nodes)
1221 CHECK (e.hash == 0x6A5924BA3389D7C);
1225 for (Node& n : nodes)
1234 ,chainJob.encodeNodeID(0)
1235 ,chainJob.encodeLevel(0)};
1237 ,chainJob.encodeNodeID(1)
1238 ,chainJob.encodeLevel(1)};
1240 ,chainJob.encodeNodeID(2)
1241 ,chainJob.encodeLevel(1)};
1243 ,chainJob.encodeNodeID(3)
1244 ,chainJob.encodeLevel(2)};
1246 CHECK (e.hash == 0);
1251 CHECK (e.hash != 0x6A5924BA3389D7C);
1256 CHECK (e.hash == 0x6A5924BA3389D7C);
1259 CHECK (e.hash != 0x6A5924BA3389D7C);
1264 array<Node,4> clone;
1265 size_t lastTouched(-1);
1266 size_t lastNode (-1);
1267 size_t lastLevel(-1);
1268 bool shallContinue{
false};
1269 auto getNodeIdx = [&](Node* n) {
return n - &nodes[0]; };
1273 auto disposeStep = [&](
size_t idx,
size_t level)
1275 Node& n = clone[idx];
1280 auto setDependency = [&](Node* pred, Node* succ)
1282 size_t predIdx = getNodeIdx(pred);
1283 size_t succIdx = getNodeIdx(succ);
1285 clone[predIdx].addSucc(clone[succIdx]);
1287 auto continuation = [&](size_t,
size_t nodeDone,
size_t levelDone,
bool work_left)
1290 lastLevel = levelDone;
1291 shallContinue = work_left;
1299 ,planJob.encodeNodeID(1)
1302 ,planJob.encodeNodeID(5)
1306 CHECK (lastLevel = 1);
1307 CHECK (lastTouched = 2);
1308 CHECK (lastTouched == lastNode);
1309 Node* lastN = &clone[lastTouched];
1310 CHECK (lastN->level == lastLevel);
1311 CHECK ( isnil (lastN->succ));
1312 CHECK (not isnil (lastN->pred));
1313 CHECK (shallContinue);
1316 CHECK (lastLevel = 3);
1317 CHECK (lastTouched = 3);
1318 CHECK (lastTouched == lastNode);
1319 lastN = &clone[lastTouched];
1320 CHECK (lastN->level == 2);
1321 CHECK (lastN->level < lastLevel);
1322 CHECK ( isnil (lastN->succ));
1323 CHECK (not isnil (lastN->pred));
1324 CHECK (not shallContinue);
1327 CHECK (lastN->hash == 0);
1328 for (Node& n : clone)
1330 CHECK (lastN->hash == 0x6A5924BA3389D7C);
static const Time ANYTIME
border condition marker value. ANYTIME <= any time value
const StatKey STAT_NODE
all nodes
void showcase_SeedChains()
const StatKey STAT_LINK
1:1 linking node
const StatKey STAT_SEED
seed node
void verify_computation_load()
const StatKey STAT_KNOT
knot (joins and forks)
void verify_adjusted_schedule()
const StatKey STAT_EXIT
exit node
double invoke(uint scaleStep=1)
cause a delay by computational load
TestChainLoad && buildTopology()
Use current configuration and seed to (re)build Node connectivity.
Generate synthetic computation load for Scheduler performance tests.
A Generator for synthetic Render Jobs for Scheduler load testing.
A front-end for using printf-style formatting.
void showcase_PruneChains()
double benchmark(uint scaleStep=1)
void verify_scheduling_setup()
»Scheduler-Service« : coordinate render activities.
void verify_reseed_recalculate()
Simplistic test class runner.
Render JobFunctor to invoke the calculation of a single Node.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
double computeWeightFactor(LevelWeight const &lw, uint concurrency)
simplified model for expense of a level of nodes, computed concurrently.
double calcRuntimeReference(microseconds timeBase=LOAD_DEFAULT_TIME, size_t sizeBase=0, size_t repeatCnt=GRAPH_BENCHMARK_RUNS)
Conduct a number of benchmark runs over processing the Graph synchronously.
TestChainLoad< 16 > ChainLoad16
shorthand for specific parameters employed by the following tests
A collection of frequently used helper functions to support unit testing.
TestChainLoad && configureShape_chain_loadBursts()
preconfigured topology: single graph with massive »load bursts«
const StatKey STAT_JOIN
joining node
Statistic computeGraphStatistics()
Operator on TestChainLoad to evaluate current graph connectivity.
Definition of a render job.
void verify_runtime_reference()
void showcase_Expansion()
const StatKey STAT_FORK
forking node
TestChainLoad && clearNodeHashes()
Clear node hashes and propagate seed value.
TestChainLoad && configureShape_short_segments3_interleaved()
preconfigured topology: simple interwoven 3-step graph segments
Render JobFunctor to perform chunk wise planning of Node jobs to calculate a complete Chain-Load grap...
Individual frame rendering task, forwarding to a closure.
void showcase_Reduction()
void showcase_StablePattern()
Vault-Layer implementation namespace root.
auto allLevelWeights()
calculate node weights aggregated per level
TestChainLoad && performGraphSynchronously(microseconds timeBase=LOAD_DEFAULT_TIME, size_t sizeBase=0)
Emulate complete graph processing in a single threaded loop.
Collector and aggregator for performance data.
A calibratable CPU load to be invoked from a node job functor.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...