Skip to content

feat: add --no-push flag for local-only writes (overlay semantics)#91

Closed
XciD wants to merge 2 commits intomainfrom
feat/overlay-dir
Closed

feat: add --no-push flag for local-only writes (overlay semantics)#91
XciD wants to merge 2 commits intomainfrom
feat/overlay-dir

Conversation

@XciD
Copy link
Copy Markdown
Member

@XciD XciD commented Apr 1, 2026

Summary

  • Adds --no-push CLI flag: allows local writes without ever uploading to remote
  • Reuses the existing advanced_writes staging infrastructure (no new write path)
  • Logs the staging directory path so the user can locate their local data

How it works

--no-push sets read_only = false and advanced_writes = true, but skips creating the FlushManager. The result:

  1. Writes go through the normal staging path (files on disk in --cache-dir/staging/)
  2. Dirty files are never flushed to remote (no FlushManager to enqueue to)
  3. Reads of dirty inodes already check the staging file first (existing behavior)
  4. Locally created inodes appear in directory listings (existing behavior)

This achieves overlay semantics in ~30 lines instead of ~200 (compared to dacorvo's overlay-write-dir which implements a parallel --upperdir write path).

Use case

Mounting a shared remote bucket (e.g. AWS Neuron compilation cache) and writing local artifacts on top without pushing back. See Slack thread.

hf-mount bucket hf://mybucket --no-push --cache-dir /persistent/cache

Notes

  • Local writes live in the staging directory under --cache-dir/staging/. The path is logged at mount time.
  • Staging files are named by inode number, not original path. Within a single mount session this is transparent (all access goes through the FUSE mount). For cross-session persistence, inode assignment is deterministic for the same remote state.

XciD added 2 commits April 1, 2026 19:02
Allow writes to be stored locally in the cache/staging directory without
ever uploading to remote storage. Reads check local files first, then
fall back to remote content (overlay semantics).

This is a simpler alternative to a full overlayfs-style upperdir
implementation: instead of adding a parallel write path, we reuse the
existing advanced_writes staging infrastructure and simply skip creating
the FlushManager, so dirty files stay local indefinitely.

Useful for caching expensive-to-produce artifacts (e.g. compilation
caches) on top of a shared read-only remote bucket.
Print the exact staging directory path so the user knows where their
local writes are stored on disk.
@XciD XciD closed this Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

POSIX Compliance (pjdfstest)

============================================================
  pjdfstest POSIX Compliance Results
------------------------------------------------------------
  Files: 130/130 passed    Tests: 832 total (0 subtests failed)
  Result: PASS
------------------------------------------------------------
  Category               Passed    Total   Status
  -------------------- -------- -------- --------
  chflags                     5        5       OK
  chmod                       8        8       OK
  chown                       6        6       OK
  ftruncate                  13       13       OK
  granular                    5        5       OK
  mkdir                       9        9       OK
  open                       19       19       OK
  posix_fallocate             1        1       OK
  rename                     10       10       OK
  rmdir                      11       11       OK
  symlink                    10       10       OK
  truncate                   13       13       OK
  unlink                     11       11       OK
  utimensat                   9        9       OK
============================================================

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Benchmark Results

============================================================
  Benchmark — 50MB
------------------------------------------------------------
  Metric                                 FUSE          NFS
  ------------------------------ ------------ ------------
  Sequential read                    260.2 MB/s     257.1 MB/s
  Sequential re-read                1458.8 MB/s    2309.5 MB/s
  Range read (1MB@25MB)               32.0 ms         0.2 ms
  Random reads (100x4KB avg)          34.1 ms         0.0 ms
  Sequential write (FUSE)           1325.9 MB/s
  Close latency (CAS+Hub)            0.090 s
  Write end-to-end                   392.7 MB/s
  Dedup write                       1559.7 MB/s
  Dedup close latency                0.096 s
  Dedup end-to-end                   391.9 MB/s
============================================================
============================================================
  Benchmark — 200MB
------------------------------------------------------------
  Metric                                 FUSE          NFS
  ------------------------------ ------------ ------------
  Sequential read                    969.2 MB/s     974.3 MB/s
  Sequential re-read                1783.1 MB/s    2307.0 MB/s
  Range read (1MB@25MB)               31.6 ms         0.2 ms
  Random reads (100x4KB avg)          34.0 ms         0.0 ms
  Sequential write (FUSE)           1390.4 MB/s
  Close latency (CAS+Hub)            0.107 s
  Write end-to-end                   796.7 MB/s
  Dedup write                       1596.2 MB/s
  Dedup close latency                0.106 s
  Dedup end-to-end                   864.1 MB/s
============================================================
============================================================
  Benchmark — 500MB
------------------------------------------------------------
  Metric                                 FUSE          NFS
  ------------------------------ ------------ ------------
  Sequential read                   1593.6 MB/s    1413.5 MB/s
  Sequential re-read                1721.6 MB/s    2422.6 MB/s
  Range read (1MB@25MB)               29.2 ms         0.2 ms
  Random reads (100x4KB avg)          33.5 ms         0.0 ms
  Sequential write (FUSE)           1493.5 MB/s
  Close latency (CAS+Hub)            0.110 s
  Write end-to-end                  1123.6 MB/s
  Dedup write                       1474.7 MB/s
  Dedup close latency                0.168 s
  Dedup end-to-end                   986.3 MB/s
============================================================
============================================================
  fio Benchmark Results
------------------------------------------------------------
  Job                        FUSE MB/s   NFS MB/s  FUSE IOPS   NFS IOPS
  ------------------------- ---------- ---------- ---------- ----------
  seq-read-100M                  458.7      537.6                      
  seq-reread-100M               2173.9       15.6                      
  rand-read-4k-100M                0.1        0.1         19         18
  seq-read-5x10M                 746.3      819.7                      
  rand-read-10x1M                  0.1        0.1         36         37
  Random Read Latency           FUSE avg      NFS avg
  ------------------------- ------------ ------------
  rand-read-4k-100M           52173.8 us   54419.9 us
  rand-read-10x1M             27805.0 us   27297.4 us
============================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant