Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ The name in `code` is what you pass to `cachesim` on the command line (names are
* [3LCache](/libCacheSim/cache/eviction/3LCache/) `3lcache` — build with `-DENABLE_3L_CACHE=ON`
* [WTinyLFU](/libCacheSim/cache/eviction/WTinyLFU.c) `wtinylfu`
* [QD-LP](/libCacheSim/cache/eviction/QDLP.c) `qdlp`
* [S3-FIFO](/libCacheSim/cache/eviction/S3FIFO.c) `s3fifo`, [S3-FIFOd](/libCacheSim/cache/eviction/S3FIFOd.c) `s3fifod`
* [S3-FIFO](/libCacheSim/cache/eviction/S3FIFO.c) `s3fifo`
* [S4-FIFO](/libCacheSim/cache/eviction/S4FIFO/S4FIFO.c) `s4fifo` — build with `-DENABLE_S4FIFO=ON`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not advertise S4-FIFO before it is available

On this commit, the documented source path does not exist, the root CMake configuration defines no ENABLE_S4FIFO option, and the algorithm registry contains no s4fifo entry. Consequently, even a user following the documented build flag gets a build where cachesim ... s4fifo is rejected, despite this section explicitly saying its code-form names are supported command-line values. Add this entry only with the implementation/build registration, or clearly mark it as unavailable rather than supported.

Useful? React with 👍 / 👎.

* [Sieve](/libCacheSim/cache/eviction/Sieve.c) `sieve`

### Admission algorithms
Expand Down
1 change: 0 additions & 1 deletion libCacheSim/cache/cacheAlgoRegistry.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ static const cache_algo_entry_t g_cache_algos[] = {
{"s3-fifo", S3FIFO_init},
{"s3-fifov0", S3FIFOv0_init},
{"s3fifo", S3FIFO_init},
{"s3fifod", S3FIFOd_init},
{"s3fifov0", S3FIFOv0_init},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve S3FIFOd for non-cachesim name lookups

This registry is shared with the public create_cache_by_name() API and MINISIM through create_cache_internal() (libCacheSim/cache/plugin.c:75 and libCacheSim/mrcProfiler/mrcProfiler.cpp:439), so removing this entry does more than disable the cachesim spelling: mrcProfiler --algo=s3fifod --profiler=MINISIM and API callers now fail. In statically linked executables, the dlsym() fallback cannot recover the constructor because no remaining reference pulls S3FIFOd.c from the archive. If only the cachesim CLI name should disappear, reject it in the cachesim path while retaining this shared mapping.

Useful? React with 👍 / 👎.

{"sieve", Sieve_init},
{"size", Size_init},
Expand Down
8 changes: 4 additions & 4 deletions test/test_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ expect_output "slru -e print with auto sizing" "n-seg=" \
"${BIN_DIR}/cachesim" "${TRACE}" vscsi slru auto -e print
expect_output "qdlp -e print" "fifo-size-ratio=" \
"${BIN_DIR}/cachesim" "${TRACE_ORACLE}" oracleGeneral qdlp 1gb -e print
expect_output "s3fifod -e print" "fifo-size-ratio=" \
"${BIN_DIR}/cachesim" "${TRACE_ORACLE}" oracleGeneral s3fifod 1gb -e print
expect_output "s3fifo -e print" "small-size-ratio=" \
"${BIN_DIR}/cachesim" "${TRACE_ORACLE}" oracleGeneral s3fifo 1gb -e print

# Sweep every algorithm the CLI registers rather than a hand-picked list: the
# crashes this covers were found in variants that a shorter list missed
Expand All @@ -189,7 +189,7 @@ ALL_ALGOS="2q 3LCache CAR GLCache RandomLRU arc arcv0 cacheus clock clock2qplus
clockpro fifo fifo-merge fifo-reinsertion fifomerge flashProb gdsf gl-cache
lecar lecarv0 lfu lfucpp lfuda lhd lirs lrb lru lru-k lru-prob mq
multiqueue nop
pluginCache qdlp random randomTwo s3-fifo s3-fifov0 s3fifo s3fifod s3fifov0
pluginCache qdlp random randomTwo s3-fifo s3-fifov0 s3fifo s3fifov0
sieve size slru slruv0 tinyLFU twoq wtinyLFU
hyperbolic belady beladySize"

Expand Down Expand Up @@ -313,7 +313,7 @@ done
# floor the result reached zero, which cache_struct_init reads as "unset" and
# replaces with the full-size default — so asking for a small table allocated
# several large ones instead. slruv0 at hashpower 4 took 18 MB against 6 MB at 5.
for algo in slruv0 s3fifod cacheus lru; do
for algo in slruv0 s3fifo cacheus lru; do
for hp in 4 5 6 8; do
expect_ok "${algo} at --hashpower=${hp}" \
"${BIN_DIR}/cachesim" "${TRACE_ORACLE}" oracleGeneral "${algo}" 10mb \
Expand Down
Loading