tensor_save returns true when the write fails (a full device, a size limit): the file is truncated and the call says it was saved
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Start with src/builtins_tensor.c and compare tensor_save with write_text and write_bytes to determine the repository’s writer error and cleanup behavior. Inspect git grep -n 'fwrite' src/ for other unchecked writers, and review docs/BUILTINS.md for the tensor_save row. Done means tests cover /dev/full, a regular file under RLIMIT_FSIZE, and successful saves, with the documented failure behavior and partial-file handling verified.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
tensor_save returns true when the write fails. It checks that the path opens and nothing after that: src/builtins_tensor.c ignores the result of every fwrite and of fclose, then returns make_bool(1).
Found by a blind review of #2468 (a documents change), which ran the sentence "returns true once the file is written" against a full device and a size limit. Seen on phase2-numbers at 05e6d6fd; the code is older than the branch.
Shows it
A device that is full:
p is buf_from_list of ([1, 2])
print of (tensor_save of [p, "/dev/full"])
prints true, nothing on stderr, exit code 0. A direct write to /dev/full fails with ENOSPC.
A regular file, with the process's file-size limit at 64 bytes (RLIMIT_FSIZE=64, SIGXFSZ ignored):
p is buf_from_list of ([1, 2])
print of (tensor_save of [p, "t.bin"])
prints true; t.bin holds 64 of the 112 bytes the same program writes without the limit. Its header declares the whole tensor. A later tensor_load of that file reads a truncated tensor.
What it does report: a path it cannot open (a missing folder, a folder as the path, no permission) returns false.
This is a saved checkpoint that says it was saved. The rule it breaks is the repository's own: no silent wrong answers.
Done when
-
tensor_savereports a failed or short write: the results offwriteandfcloseare checked, and a failure is the builtin's failure answer (and, like the other file writers, a catchableioerror where the repository's rule for writers says so: decide on this issue which, from whatwrite_textandwrite_bytesdo). - A truncated file is not left behind as if whole: write to a temporary name and rename, or remove the partial file, whichever the other writers do.
- A test shows both failures red first on the code as it is: the full device, and a size limit on a regular file; and the unchanged success path.
- The other tensor and model writers of
src/that return a success bit are listed with whether they check their writes (git grep -n 'fwrite' src/), and each unchecked one is fixed here or named in an issue of its own. -
docs/BUILTINS.md's row oftensor_savesays what it returns on success and on each failure.
— Claude DevBox
- Ngôn ngữ chính
- C
- Star
- 3
- Fork
- 7
- Merge trung bình
- 3 giờ 28 phút
- Pull request đã merge (30 ngày)
- 270
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của InauguralSystems/EigenScript
-
area:gates kind:gate-defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
InauguralSystems/EigenScript#2476 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:gates needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
InauguralSystems/EigenScript#2462 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The hosted-RNG check refuses a clean tree that has a tracked file with a double quote in its nameĐang mởarea:gates kind:gate-defect needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
InauguralSystems/EigenScript#2461 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:gates kind:gate-defect needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
InauguralSystems/EigenScript#2458 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a wordĐang mởarea:http kind:silent-wrong
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
InauguralSystems/EigenScript#2394 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InauguralSystems/EigenScript
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
flipperdevices/flipperzero-firmware#4520 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/build-framework kind/enhancement priority/low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
yugabyte/yugabyte-db#38826 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
meshcore-dev/MeshCore#3891 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug grammar sev-3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
BUG/MEDIUM: regex: worker SIGSEGV when a regex is applied to an empty body on libc-regex buildsĐang mởstatus: needs-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100