Skip to content

Commit 1827f80

Browse files
committed
misc fixes / stats work
1 parent 9c48f4d commit 1827f80

File tree

7 files changed

+78
-52
lines changed

7 files changed

+78
-52
lines changed

omnilink/lib/include/omnilink/pack.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ struct pack<std::variant<Variants...>> {
5252
}
5353
};
5454

55+
#if __cplusplus >= 202002L
56+
5557
template <typename T, std::size_t extent>
5658
struct pack<std::span<T, extent>> {
5759
template <typename Stream>
@@ -64,6 +66,8 @@ struct pack<std::span<T, extent>> {
6466
}
6567
};
6668

69+
#endif
70+
6771
template <>
6872
struct pack<omnilink::Packable> {
6973
template <typename Stream>

omnilink/package.mill

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,8 @@ trait TracingConfigModule extends Module:
960960
success = success,
961961
duration = Duration.between(startTime, endTime),
962962
peakMemory = peakMemory,
963+
threadCount = threadCount,
964+
operationCount = operationCount,
963965
)
964966
,
965967
porcupine = porcupine.headOption.map:
@@ -968,6 +970,8 @@ trait TracingConfigModule extends Module:
968970
success = success,
969971
duration = Duration.between(startTime, endTime),
970972
peakMemory = peakMemory,
973+
threadCount = threadCount,
974+
operationCount = operationCount,
971975
),
972976
)
973977
end stats
@@ -988,5 +992,7 @@ object TracingConfigModule:
988992
success: Boolean,
989993
duration: Duration,
990994
peakMemory: Long,
995+
threadCount: Int,
996+
operationCount: Int,
991997
) derives upickle.default.ReadWriter
992998
end TracingConfigModule

omnilink/plots/env.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
mkShell,
3+
python313Packages,
4+
python313
5+
}:
6+
mkShell {
7+
packages = [
8+
python313Packages.matplotlib
9+
python313
10+
];
11+
}

omnilink/plots/flake.nix

Lines changed: 0 additions & 22 deletions
This file was deleted.

omnilink/plots/package.mill

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,31 @@ import java.time.Duration
66
import mill.api.TaskCtx
77

88
object `package` extends Module:
9-
def flake = Task.Source(os.sub / "flake.nix")
10-
119
def setbenchPorcupineTimePlotScript =
1210
Task.Source(os.sub / "setbench_porcupine_time_plt.py")
1311
def setbenchPorcupineMemPlotScript =
1412
Task.Source(os.sub / "setbench_porcupine_mem_plt.py")
1513

1614
def setbenchPorcupinePlots(eval: Evaluator) =
1715
Task.Command(exclusive = true)[Unit]:
18-
val stats: Seq[(String, Int, build.omnilink.TracingConfigModule.Stats)] =
16+
val modules = Seq[build.omnilink.setbench.SetBenchTracingConfigModule](
17+
build.omnilink.setbench.brown_ext_chromatic_augment_lf,
18+
build.omnilink.setbench.brown_ext_chromatic_augment_lf_bug1,
19+
build.omnilink.setbench.brown_ext_chromatic_augment_lf_bug2,
20+
build.omnilink.setbench.brown_ext_chromatic_augment_lf_bug3,
21+
build.omnilink.setbench.brown_ext_chromatic_augment_lf_bug4,
22+
)
23+
val stats: Seq[build.omnilink.TracingConfigModule.Stats] =
1924
eval
2025
.execute:
21-
???
22-
// build.omnilink.setbench.brown_ext_chromatic_augment_lf.opCountScan.crossModules
23-
// .map: m =>
24-
// m.traces.crossModules.map(
25-
// _.stats.map((m.configId, m.operationCount * m.threadCount, _)),
26-
// )
27-
// .flatten
26+
modules
27+
.map: m =>
28+
m.opCountScan.crossModules
29+
.map: m =>
30+
m.traces.crossModules.map: t =>
31+
t.stats
32+
.flatten
33+
.flatten
2834
.values
2935
.get
3036

@@ -36,18 +42,14 @@ object `package` extends Module:
3642
)
3743

3844
val data = stats.flatMap:
39-
case (
40-
_,
41-
opCount,
42-
build.omnilink.TracingConfigModule
43-
.Stats(omnilinkOpt, porcupineOpt),
44-
) =>
45+
case build.omnilink.TracingConfigModule
46+
.Stats(omnilinkOpt, porcupineOpt) =>
4547
omnilinkOpt.toList
4648
.map: stats =>
4749
(
4850
"omnilink",
4951
stats.success,
50-
opCount,
52+
stats.operationCount,
5153
stats.duration,
5254
stats.peakMemory,
5355
)
@@ -56,7 +58,7 @@ object `package` extends Module:
5658
(
5759
"porcupine",
5860
stats.success,
59-
opCount,
61+
stats.operationCount,
6062
stats.duration,
6163
stats.peakMemory,
6264
)
@@ -105,7 +107,9 @@ object `package` extends Module:
105107
cmd = List[os.Shellable](
106108
"nix",
107109
"develop",
108-
flake().path,
110+
"--impure",
111+
"--expr",
112+
s"(import ${build.omnilink.pkgs().path}).omnilink.plots_env",
109113
"-c",
110114
"python",
111115
setbenchPorcupineTimePlotScript().path,
@@ -120,7 +124,9 @@ object `package` extends Module:
120124
cmd = List[os.Shellable](
121125
"nix",
122126
"develop",
123-
flake().path,
127+
"--impure",
128+
"--expr",
129+
s"(import ${build.omnilink.pkgs().path}).omnilink_plots_env",
124130
"-c",
125131
"python",
126132
setbenchPorcupineMemPlotScript().path,

omnilink/setbench/package.mill

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ object `package` extends Module:
1010

1111
object brown_ext_chromatic_augment_lf extends SetBenchTracingConfigModule:
1212
def nixName = "omnilink.setbench.workload.brown_ext_chromatic_augment_lf"
13-
14-
trait opCountScanModule extends Cross.Module[Int], ConfigModule:
15-
def threadCount = 5
16-
def operationCount = crossValue
17-
end opCountScanModule
18-
19-
object opCountScan extends Cross[opCountScanModule](100 to 100000 by 10000)
2013
end brown_ext_chromatic_augment_lf
2114

2215
object brown_ext_chromatic_augment_lf_bug1
@@ -37,6 +30,12 @@ object `package` extends Module:
3730
"omnilink.setbench.workload.brown_ext_chromatic_augment_lf_linbug3"
3831
end brown_ext_chromatic_augment_lf_bug3
3932

33+
object brown_ext_chromatic_augment_lf_bug4
34+
extends SetBenchTracingConfigModule:
35+
def nixName =
36+
"omnilink.setbench.workload.brown_ext_chromatic_augment_lf_linbug4"
37+
end brown_ext_chromatic_augment_lf_bug4
38+
4039
object brown_ext_chromatic_delegateSingle_lf
4140
extends SetBenchTracingConfigModule:
4241
def nixName =
@@ -91,9 +90,9 @@ object `package` extends Module:
9190
// TODO: this one "works" but crashes on insert-replace as it is unsupported.
9291
// Fix this somehow.
9392

94-
object ellen_augmented_ext_bst_lf extends SetBenchTracingConfigModule:
95-
def nixName = "omnilink.setbench.workload.ellen_augmented_ext_bst_lf"
96-
end ellen_augmented_ext_bst_lf
93+
// object ellen_augmented_ext_bst_lf extends SetBenchTracingConfigModule:
94+
// def nixName = "omnilink.setbench.workload.ellen_augmented_ext_bst_lf"
95+
// end ellen_augmented_ext_bst_lf
9796

9897
trait SetBenchTracingConfigModule extends build.omnilink.TracingConfigModule:
9998
def nixName: String
@@ -125,5 +124,21 @@ object `package` extends Module:
125124
def threadCount = 5
126125
def operationCount = 1000000
127126
end longConfig2
127+
128+
trait opCountScanModule extends Cross.Module[Int], ConfigModule:
129+
def threadCount = 5
130+
def operationCount = crossValue
131+
end opCountScanModule
132+
133+
object opCountScan extends Cross[opCountScanModule](100 to 100000 by 10000)
134+
135+
trait threadCountScanModule extends Cross.Module[Int], ConfigModule:
136+
def threadCount = crossValue
137+
def operationCount = 100
138+
end threadCountScanModule
139+
140+
object threadCountScan
141+
extends Cross[threadCountScanModule](1, 5, 10, 15, 20, 25, 30, 35, 40,
142+
45, 50)
128143
end SetBenchTracingConfigModule
129144
end `package`

omnilink/static_overlay.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ final: prev: {
44

55
porcupine = final.callPackage ./porcupine/package.nix {};
66

7+
plots_env = final.callPackage ./plots/env.nix {};
8+
79
# WiredTiger
810
wiredtiger = (prev.omnilink.wiredtiger or {}) // {
911
lib.v11_3_1 = final.callPackage ./wiredtiger/wiredtiger.nix {
@@ -69,6 +71,10 @@ final: prev: {
6971
ghRev = "e4c751792e4d98ac68b8a7d50b7964e09f942997";
7072
setbenchSubdir = "ds/brown_ext_chromatic_augment_lf";
7173
};
74+
brown_ext_chromatic_augment_lf_linbug4 = final.callPackage ./setbench/workload.nix {
75+
ghRev = "cb4562bb8459b848685738fb1f00c2a015b56be2";
76+
setbenchSubdir = "ds/brown_ext_chromatic_augment_lf";
77+
};
7278
brown_ext_chromatic_delegateSingle_lf_linbug1 = final.callPackage ./setbench/workload.nix {
7379
ghRev = "938927dac7a3e8e0b767a04f84f02ea03c316bd1";
7480
setbenchSubdir = "ds/brown_ext_chromatic_delegateSingle_lf";

0 commit comments

Comments
 (0)