deepseek-ai / deepseek-ai/DeepJIT

Disk cache commit reports success after unsuccessful publication

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
310
Forks
26
Avg merge
4m
Merged PRs (30d)
1

Description

`DiskCacheEntry::commit()` treats every failed rename as a competing writer successfully publishing the entry. If the destination is incomplete, it deletes the completed temporary build and returns the incomplete destination with `hit` and `committed` set to true. A permission failure can return a path that does not exist at all.

Reproduced at `8b3ef868705a3792cc1a14ab570b539f72fd3d94` on Linux:

1. Obtain a cache miss and write a payload into `entry.path`.
2. Create `entry.commit_path` with a `partial` file and no `.committed` marker.
3. Call `entry.commit()`. Renaming over the nonempty destination fails.
4. The call nevertheless returns that destination as successful, and the temporary payload is gone.

Repeating the operation against the same incomplete destination fails the same way. Denying write permission on the destination parent also produces false success. Normal publication and reuse of a competing committed entry pass their control cases.

Expected: reuse the destination only when a committed entry is visible there. Otherwise report the original rename error and keep the temporary build available for retry or cleanup when the entry is destroyed. After a failed rename, leave the incomplete destination untouched.

The unchecked fallback is in [`DiskCacheEntry::commit`](https://github.com/deepseek-ai/DeepJIT/blob/8b3ef868705a3792cc1a14ab570b539f72fd3d94/include/deep_jit/cache/disk.hpp#L54-L66). It affects both backends through the shared runtime: `compile_without_load()` can return an invalid artifact path, while `compile()` subsequently fails loading the binary.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with include/deep_jit/cache/disk.hpp at DiskCacheEntry::commit(), especially lines 54-66, and reproduce the incomplete-destination and permission-failure cases described in the issue. Compare them with normal publication and committed-entry reuse. Done means failed publication reports the original rename error, preserves the temporary build, and leaves an incomplete destination untouched while normal reuse still succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.