Skip to content

Commit 3c8465e

Browse files
committed
attempt reclaimer_none, Storage2 edits
1 parent 3368adb commit 3c8465e

File tree

10 files changed

+501
-12
lines changed

10 files changed

+501
-12
lines changed

omnilink/package.mill

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,14 @@ def hppOverlay: T[PathRef] = Task:
5050
PathRef(overlay)
5151
end hppOverlay
5252

53-
def staticOverlayUnsafe: T[PathRef] = Task.Source(os.sub / "static_overlay.nix")
53+
def staticOverlay: T[PathRef] = Task.Source(os.sub / "static_overlay.nix")
5454

5555
def dependOnEntireModuleDir: T[Seq[PathRef]] = Task.Input:
5656
os.list(build.omnilink.moduleDir)
5757
.filterNot(_.last.contains(".duckdb")) // exclude for _severe_ perf reasons
5858
.map(PathRef(_))
5959
end dependOnEntireModuleDir
6060

61-
def staticOverlay: T[PathRef] = Task:
62-
dependOnEntireModuleDir()
63-
// Nix has its own dedup method, hammering its caching
64-
// on every change should be fine.
65-
staticOverlayUnsafe()
66-
end staticOverlay
67-
6861
def pkgs: T[PathRef] = Task:
6962
val file = Task.dest / "pkgs.nix"
7063
val contents = s"""

omnilink/setbench/package.mill

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ object `package` extends Module:
4343
"omnilink.setbench.workload.brown_ext_chromatic_delegateSingle_lf"
4444
end brown_ext_chromatic_delegateSingle_lf
4545

46+
object brown_ext_chromatic_delegateSingle_lf_noreclaim
47+
extends SetBenchTracingConfigModule:
48+
def nixName =
49+
"omnilink.setbench.workload.brown_ext_chromatic_delegateSingle_lf_noreclaim"
50+
end brown_ext_chromatic_delegateSingle_lf_noreclaim
51+
4652
object brown_ext_chromatic_delegateSingle_lf_bug1
4753
extends SetBenchTracingConfigModule:
4854
def nixName =

omnilink/setbench/workload.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
ghUrl ? "git@github.com:ubc-systopia/augmented-chromatic-trees.git",
99
ghRev,
1010
setbenchSubdir,
11+
shouldReclaimMemory ? true,
1112
}:
1213
let
1314
setbenchSrc = builtins.fetchGit {
@@ -32,6 +33,7 @@ stdenv.mkDerivation {
3233
cmake
3334
];
3435
env.SETBENCH_SUBDIR = setbenchSubdir;
36+
env.SETBENCH_SHOULD_RECLAIM_MEMORY = shouldReclaimMemory;
3537
sourceRoot = "workload";
3638
postInstall = ''
3739
chmod a+x $out/bin/main

omnilink/setbench/workload/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ target_include_directories(main PRIVATE
2121
"../source/$ENV{SETBENCH_SUBDIR}"
2222
)
2323
target_link_libraries(main msgpack-cxx OmniLink::OmniLink)
24+
if($ENV{SETBENCH_SHOULD_RECLAIM_MEMORY})
25+
target_compile_definitions(main PRIVATE SETBENCH_SHOULD_RECLAIM_MEMORY)
26+
endif()
2427

2528
install(DIRECTORY ${PROJECT_BINARY_DIR}/main
2629
DESTINATION bin

omnilink/setbench/workload/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ thread_local int tid = 0;
2323

2424
#include "adapter.h"
2525

26+
#ifdef SETBENCH_SHOULD_RECLAIM_MEMORY
2627
using DataStructure = ds_adapter<int32_t, int32_t>;
28+
#else
29+
using DataStructure = ds_adapter<int32_t, int32_t, reclaimer_none<int32_t>>;
30+
#endif
2731

2832
struct context_init_t {
2933
DataStructure& ds;

omnilink/static_overlay.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ final: prev: {
5252
ghRev = "9a8c04ccdaefb2d4ab893367f7ff99a593d51aa6"; # main as of paper sub
5353
setbenchSubdir = "ds/brown_ext_chromatic_delegateSingle_lf";
5454
};
55+
brown_ext_chromatic_delegateSingle_lf_noreclaim = final.callPackage ./setbench/workload.nix {
56+
ghRev = "9a8c04ccdaefb2d4ab893367f7ff99a593d51aa6"; # main as of paper sub
57+
setbenchSubdir = "ds/brown_ext_chromatic_delegateSingle_lf";
58+
shouldReclaimMemory = false;
59+
};
5560
brown_ext_chromatic_augment_lf_linbug1 = final.callPackage ./setbench/workload.nix {
5661
ghRev = "a99d464a7dd0e8958c2093b3143dc3f069803dc5";
5762
setbenchSubdir = "ds/brown_ext_chromatic_augment_lf";

omnilink/wiredtiger/MCStorage2.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
SPECIFICATION RefinementSpec
2+
3+
CONSTANTS
4+
RC ="snapshot"
5+
WC = "majority"
6+
7+
Keys = {k1, k2, k3}
8+
MTxId = {t1, t2, t3}
9+
Timestamps = {10, 20, 30}
10+
Node = {"n"}
11+
NoValue = NoValue
12+
13+
CONSTRAINT StateConstraint
14+
15+
PROPERTY IsRefinedByStorage
16+
17+
SYMMETRY Symmetry

omnilink/wiredtiger/MCStorage2.tla

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---- MODULE MCStorage2 ----
2+
EXTENDS Storage2
3+
4+
Storage == INSTANCE Storage
5+
6+
IsRefinedByStorage ==
7+
[][Next]_vars
8+
9+
RefinementSpec ==
10+
Storage!Init /\ [][Storage!Next]_vars
11+
12+
StateConstraint ==
13+
/\ Len(mlog["n"]) <= 3
14+
15+
====

omnilink/wiredtiger/Storage.tla

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ LogEntries ==
8181

8282
Logs == Seq(LogEntries)
8383

84-
Max(S) == CHOOSE x \in S : \A y \in S : x >= y
84+
Max(S) == IF S = {} THEN 0 ELSE CHOOSE x \in S : \A y \in S : x >= y
8585

8686
--------------------------------------------------------
8787

@@ -92,9 +92,6 @@ CommitTimestamps(n) == {mlog[n][i].ts : i \in DOMAIN mlog[n]}
9292

9393
ActiveReadTimestamps(n) == { IF ~mtxnSnapshots[n][tx]["active"] THEN 0 ELSE mtxnSnapshots[n][tx].ts : tx \in DOMAIN mtxnSnapshots[n]}
9494

95-
\* Next timestamp to use for a transaction operation.
96-
NextTs(n) == Max(PrepareOrCommitTimestamps(n) \cup ActiveReadTimestamps(n)) + 1
97-
9895
ActiveTransactions(n) == {tid \in MTxId : mtxnSnapshots[n][tid]["active"]}
9996
PreparedTransactions(n) == {tid \in ActiveTransactions(n) : mtxnSnapshots[n][tid].prepared}
10097

0 commit comments

Comments
 (0)