haskell-te: 39f82af07a9b97ab02a562126f312f59aff39000
1: # Scripts, mostly from tipBenchmarks, which are useful for analysing output
2: { attrsToDirs, bash, fail, filterToSampled, genQuickspecRunner, jq, lib,
3: runCommand, testData, tipBenchmarks, withDeps, wrap }:
4:
5: with builtins;
6: with rec {
7: scripts = attrsToDirs {
8: bin = lib.genAttrs [ "choose_sample" "conjectures_for_sample" "decode"
9: "precision_recall_eqs" ]
10: (name: wrap {
11: inherit name;
12: file = "${tipBenchmarks.tools}/bin/${name}";
13: }) // {
14: conjectures_for_sample = wrap {
15: name = "conjectures_for_sample";
16: paths = [ tipBenchmarks.tools ];
17: script = ''
18: #!${bash}/bin/bash
19: decode | conjectures_for_sample
20: '';
21: };
22: };
23: };
24:
25: canFindComm = runCommand "can-find-commutativity"
26: {
27: inherit (tipBenchmarks) commDeps;
28: buildInputs = [ fail filterToSampled genQuickspecRunner jq scripts ];
29: asts = testData.tip-benchmark.asts;
30: OUT_DIRS = toJSON [(testData.tip-benchmark.nixed)];
31: SAMPLED_NAMES = "global746970323031352f62696e5f646973747269622e736d7432706c7573";
32: }
33: ''
34: set -e
35: SAMPLE=$(cat "$commDeps")
36: export SAMPLE
37:
38: FLT=$(filterToSampled < "$asts") || fail "Couldn't filter"
39: RUN=$(echo "$FLT" | genQuickspecRunner) || fail "Couldn't gen runner"
40: EQS=$("$RUN") || fail "Couldn't gen eqs"
41: CON=$(echo "$EQS" | conjectures_for_sample) || fail "Couldn't look up eqs"
42: echo "$CON" | jq -e '.precision | . > 0' || fail "No/zero precision"
43: echo "$CON" | jq -e '.recall | . > 0' || fail "No/zero recall"
44: mkdir "$out"
45: '';
46: };
47: withDeps [ canFindComm ] scripts
Generated by git2html.