Repository navigation
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d0586226d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Workbooks and workbook templates become tab-separated text per visible sheet, read in the browser with fflate and DOMParser like OpenDocument files: shared and inline strings, booleans, errors, and dates, times and durations by their number format. Hidden sheets, rows and columns are skipped, and inflate size and extracted text are bounded. The OpenDocument composer adapter is generalised so both formats share its read-on-add lifecycle, and desktop drop and paste route the new types to the composer.
Slides are read in deck order as [Slide N] text blocks, skipping hidden slides and shapes and the Fallback copy of mc:AlternateContent. Relationship ids are now matched by namespace, since <p:sldId> also carries a plain numeric id. Desktop drop and paste accept the new extensions.
A small in-house RTF reader turns the document body into text: font, colour and style tables, metadata, pictures, field codes, headers and footers are skipped, and tables become tab-separated rows. Escaped bytes decode by the current font's charset, falling back to the ANSI code page, since macOS TextEdit writes cp1252 bytes under \ansicpg936 on Chinese systems; a byte written literally after an escaped double-byte lead joins it. Desktop drop and paste accept .rtf.
Model backends take JPEG, PNG, WebP and GIF, so these formats are re-encoded in the webview before they are attached: HEIC/HEIF to JPEG, the rest to lossless PNG. A webview that cannot decode a format says so and names the file. Conversion is held against send in both composers, a failed or removed conversion never sends the source file, and a desktop drop converts per file so one unreadable image does not stop the batch. Desktop drop and paste accept the new extensions.
Blu-ray and AVCHD camcorder clips are accepted by extension on every chat video path. The video/mp2t MIME is not claimed, because browsers also give TypeScript .ts files that type and the video adapter is matched before the text one.
5d05862 to
e18d016
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e18d016ddb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e18d016 to
cd4a80d
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
An MPEG transport stream named .mts or .ts was accepted as TypeScript and read as UTF-8 text. The composer, desktop drop and clipboard readers now look for the 0x47 sync byte at the start of three consecutive 188-byte packets (192 bytes for M2TS) and send a stream down the video path as video/mp2t, while TypeScript files stay text, including those the browser labels video/mp2t. The native readers take .ts and .mts under the video cap and reapply the text cap once the bytes say TypeScript. The video reference slot offers .ts and .mts too, and refuses TypeScript once it has read the file.
iWork 2013 and later save a document as a zip of Snappy-compressed protobuf archives (Index/*.iwa) with no published schema. A small reader unpacks those archives under the Office reader's size caps, resolves object references, and returns the Pages body text with inline-object placeholders dropped. Desktop drop and paste accept .pages.
The iWork reader walks a Keynote deck's slide tree in order and reads each slide's title and body placeholders, then its drawables, following object references from them. Skipped slides keep their number, and builds, template slides and speaker notes are left out, as the PPTX reader does. Every object is walked at most once per document, so shared structure, a slide shared by two nodes or a node listed twice cannot multiply the work. Desktop drop and paste accept .key.
The iWork reader reads each Numbers sheet's text boxes and tables in order: table rows come from the table's tiles, cells from the version-5 cell storage (numbers kept exact from their decimal128 form, dates, booleans, durations, errors) and the table's string and rich-text lists. Rows become tab-separated lines under the attachment text budget, and table rows and list entries are charged against a size budget so a flood of tiny ones is refused. Keynote tables read the same way. Desktop drop and paste accept .numbers.
Adds POST /api/chat/attachment-files, a per-account content-addressed store for the original bytes of chat attachments (200 MB cap, streamed past the body buffer). Re-uploading the same bytes renews the file. A sweep at startup and after chat, project and attachment deletion removes files not uploaded for 24 hours that no stored message references; uploads and the sweep share a lock so a renewal cannot race a deletion.
A chat request can name stored attachments in sandbox_attachments. When the python tool is enabled, they are copied into the session sandbox under .unsloth_attachments/<id prefix>/<name> before the request reaches any backend, without following links and without replacing a file already there, so the model's edits survive later turns. The upload response returns that path. An unmodified copy does not count as the user's file when a chat is deleted.
Document attachments (text, HTML, PDF, DOCX, OpenDocument, Office Open XML, RTF, iWork) upload their original file at send, alongside the inline text they already carry; the stored reference is saved with the message. On each turn where the python tool runs in Unsloth Studio, every stored attachment in the history names its sandbox path and the request asks for the copies. Other turns are unchanged, so models without tools still read the inline text. An upload failure keeps the attachment inline-only. The attachment download serves the stored original when it exists.
Adds .parquet, .feather, .arrow, .orc, .sqlite, .sqlite3, .db, .zip, .tar, .gz, .tgz, .bz2, .xz, .npy, .npz, .epub, .mobi, .xps, .oxps, .docm, .dotx, .odp and .odg to the chat composer, paste and desktop drop. The browser cannot read these, so the file is uploaded while it sits in the composer and reaches the model only as a copy in the python tool's working directory. They are refused unless the selected model runs Unsloth Studio's python tool, and a preview shows a short note instead of decoding the bytes.
… install can open Widens the tool-only attachment list to data, database, archive, ebook, Office template and macro, 3D, font and image formats that libraries shipped with every install (pandas, pyarrow, scipy, duckdb, PyMuPDF, fontTools, Pillow, safetensors and the standard library) can open.
The sandbox note for a stored attachment now names a call that opens it with an installed library, such as fitz.open(path), sqlite3.connect(path) or zipfile.ZipFile(path) for Excel workbooks, so the model does not guess a package that refuses the file or is missing. Calls take a path variable because the sandbox scanner reads a string literal passed to .connect() as a network host.
The attachment upload now returns a preview for tool-only images, documents and drawings, so the message can carry what the file holds instead of only its sandbox path: images the vision path cannot show become a PNG with a description, PyMuPDF documents become their text, and ODP, ODG and VSDX become the text of their pages. Nothing reads the preview yet. A preview runs in a spawned child that is killed after ten seconds, because MuPDF lays out one long paragraph in quadratic time and no bound on the input catches that; a timeout, a dead child or a reader error all mean no preview, and the upload still succeeds. Inside the child each reader is bounded by what its library actually loads. Images open only as the format their extension names, since Pillow otherwise picks a decoder from the bytes and icons decode their embedded frames while opening, so each frame's own header is read first. Documents are told their format rather than letting MuPDF guess from the stored file's hash name, and a document that is a zip is refused when its central directory or any member is too large for the reader to take whole. Pages, XML bytes and the text built from them have their own budgets, each marked in the text when it cuts.
…ool can read Zip and tar archives now preview as a listing of their entries with the text of the small ones, and a single compressed file as its text, or an outline of its size when the content is not text. Both are built in the same bounded child as the other previews, and nothing reads the preview yet. Each reader is bounded by what its library actually reads rather than by the file's size. A zip's central directory is sized with the end record ZipFile itself locates, so an archive whose directory is too large to parse is listed as such instead. Only stored and deflated members are read, because ZipFile limits what one read inflates for deflate alone. A tar is read in one streaming pass over a capped decompressed stream, which bounds its extended headers as well as the member data skipped along the way, and the listing says it is incomplete whenever that cap is reached; member names that are not UTF-8 are replaced rather than surrogate-escaped, which the response could not encode. A compressed file reads up to the text cap plus one byte and marks the text when the cut falls short of that many characters.
Chat attachments that only the python tool can open now carry an outline for the remaining data formats: Parquet, Arrow IPC and Feather, ORC, Stata, SAS (`.sas7bdat` and `.xpt`), NumPy `.npy` and `.npz`, and safetensors. The message a model receives says what the file holds - its shape, its columns, its first rows, or the arrays and tensors inside it - rather than only where the file is. Every reader is bounded by what the file itself states it would make its library read, and each budget cut is marked in the output, because a preview must cost about the same for a large attachment as for a small one: - Parquet decodes a page at a time, so the bound is the uncompressed size each row group states, checked for every group the five-row sample fills from. - ORC and Arrow IPC materialise a whole stripe or batch and state nothing about how large it is, so they are read through `pyarrow.dataset`, whose row count comes from the footer, and sampled only when the file is small, the cells fit the budget and no column is nested. - Stata decodes its long-string table whole on the first row read, and every value label with it. Both sizes come from the file's own map, which is walked by the lengths the header states rather than searched, because a dataset label is free text that can hold the same tags. A table too large to read through leaves the values as their stored codes, or leaves the sample out when the rows cannot be read without it. - A sas7bdat states the header and page lengths pandas asks for before it has read anything, and Python reserves the whole buffer even for a read a short file cannot fill, so those claims are checked first. Character columns are decoded with the encoding the file names when Python has that codec. - Arrays over the budget are described from their header alone, and `numpy` is given this module's header budget rather than its own default, which a wide structured dtype exceeds in an otherwise small file. Formats are taken from the attachment's filename, never from the stored path, which is a hash with no extension. Text that cannot survive a round trip through UTF-8 is replaced before it leaves the reader, because a name inside a file can hold a lone surrogate that the JSON response cannot encode. Nothing reads these previews yet; the frontend change follows.
SQLite databases, STL, PLY, GLB, 3MF and KMZ models and TTF/OTF/TTC fonts previously reached the model as a tool-only note, so a message carried nothing about what the file held. Each now outlines what the file states about itself: a database its tables with their columns, row counts and first rows; a mesh its triangle or element counts and the name it carries; a glTF its scene counts, generator and mesh names; a 3MF or KMZ the model or map inside the container over the container's own listing; a font its name, glyph count and fixed pitch. Every reader stays inside what the file says reading it would cost, and says so whenever a budget cuts what it shows. - A SQLite cell is loaded whole by any select that returns it, so cells are measured with octet_length, which answers from the record header, and a cell too large to show is described by its type and size instead. Builds without octet_length cannot size a cell without reading it, so they report no rows rather than read one. - Views and virtual tables compute what they hand back, so nothing in the file states what five rows of one would cost. They are listed but never sampled, identified by having no b-tree of their own rather than by the schema text, which can be written to say anything. - Opening any table parses every CREATE in the file, which a file can be written to make expensive several times over. The preview process therefore carries a limit on what SQLite may allocate; the limit can be lowered but never lifted, so it belongs to that process and a reader only asks whether one is in force. - A model or map inside a container is found through what the package declares, falling back to the conventional name, and is read only when the directory's stated size is within the XML budget. - Header windows, listings and element text all mark what they leave out, including where the text strips back short enough that the outline cap would otherwise stay silent.
A file only the python tool can read reached the model as one line naming it, so the model had to open it with the tool before it knew what was in it. The upload response already carries a preview of such a file — an image, the document's text, or an outline — and this puts that preview in the message. `uploadAttachmentFile` now returns the preview, shape-checked the way the response's other fields already were, and `toolOnlyAttachmentContent` turns it into the attachment's content: an image part with a description line, the document's text under a `[FORMAT: name]` header, or an outline under `[Outline of name]`. A file with no preview reads exactly as it did before, as does a failed upload. The image part is added only when the chat model takes images. That check was a thirty-line block inside `VisionImageAdapter.add`; it is now `imageInputUnavailableReason()`, called from both places, so the two cannot drift apart. What the message persists is `storedAttachmentFile(upload)` rather than the upload itself: the preview's bytes are already in the message's content, so storing them again would put the same text, or the same image, in the history twice. It keeps one thing the preview decided — whether the file's own text is inline — because the note that tells the model where the file lives says "its text is below, so answer from it" only when that text really is below. An outline is not the whole file, so outlines and images keep the note that points at the python tool. No change was needed where the request is built: the parts of every attachment are already walked whatever the attachment's type. One behaviour follows from sending the image: a thread that carries an image cannot be continued on a text-only model, which is how the chat already treats images, and a tool-only image attachment now joins them.
cd4a80d to
b2809eb
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2809ebb48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex converged on |
…nslothai#17459) ## Summary Moves Studio's stable-diffusion.cpp prebuilt from `master-982-0518b34-uba6ac30` to `master-982-0518b34-ueb0e729`, the release built from fork master `eb0e729`. That is 36 fork commits on top of the current pin. The tag keeps the `master-982` prefix because the fork's release naming still counts from its last upstream release tag. What the new build brings: - Upstream resync to `master-1056` (unslothai/stable-diffusion.cpp#54): packed INT4 convrot, MiniMax-H3 QKV chunking, RelayVSR, SDXL ControlNet Union. Also Cosmos3-Nano-Sim-Transfer video-to-video (#53). - x86 CPU: llamafile tinyBLAS GEMM for Q8_0 (#42), F16 / BF16 (#47) and Q4_1 / Q5_0 / Q5_1 (#56) weights; an int8 tiled GEMM for Q8_0 / Q4_0 / Q4_1 / Q5_0 / Q5_1 / IQ4_NL (#76); AVX512 kernels on Intel and a faster direct convolution by default (#36, #70); Q4_K / Q2_K kept on the tiled matmul on AMD (#57); Q5_0 / Q5_1 / Q4_1 through the Q8_0 GEMM at diffusion batch sizes (#74); tiled flash attention and SIMD max fixes (#66, #68, #62). - aarch64 CPU: ik_llama.cpp GEMM kernels for K-quant and I-quant weights (#48, #75), a NEON + i8mm variant for 128-bit SVE cores (#58), SVE flash attention on the NEON path (#69), a 4x4 flash attention register tile (#67). - Metal: long graphs spread over more command buffers so the GPU watchdog does not fire (#44), a coalesced im2col kernel (#45), flash attention `auto` now means on without the timing probe (#46). - Vulkan: RMS norm for short rows (#37), direct convolution chosen by an output check instead of a timing race (#38), no host-buffer import on AMD and MoltenVK (#60). - HIP: bf16 WMMA operands for gfx11 / gfx12 (#59), FP32 accumulators in the tile flash attention kernel (#61). - CUDA: the Q8_1 block sum is computed from the quantized values, which lowers matmul error for Q4_1 / Q5_1 / Q4_K / Q5_K / Q2_K weights (#63); BF16 cuBLAS for large Q8_0 matmuls on A100, Hopper and datacenter Blackwell (#39). - Memory: the conditioning cache keeps entries across output sizes and denoiser-only LoRA changes (#71); auto-fit charges unified-memory devices against the RAM budget (#73, `SD_AUTOFIT_UMA=0` disables); CPU-resident text-encoder weights are released when the next phase would not fit (#72, `SD_TE_RELEASE=0` disables); `--mmap` repacks only what the CPU repacks (#43); Qwen Image 2.1 prefix cache concatenated in F16 (#64). - Packaging: bundles are smaller (#41; the Linux CPU bundle is 38.4 to 26.0 MiB, Linux CUDA 12 is 368.5 to 338.3 MiB, Linux Vulkan is 57.9 to 30.5 MiB), the Linux CPU bundles are run on emulated CPUs before shipping (#49), and there is a new native Windows arm64 CPU bundle (#55). ## Changes - `studio/install_sd_cpp_prebuilt.py`: `DEFAULT_TAG` now names the new release. - Tests that pin the release name and its asset list now point at the new tag. `test_sd_cpp_args.py` keeps the old pin in its list of builds that support `--mmap`. - The pinned asset lists gain `win-cpu-arm64`, with a test that a Windows ARM64 host gets that bundle for `auto` / `cpu` while an x64 host keeps `win-cpu-x64`, and that ARM64 with `cuda` or `vulkan` still gets no match. No Studio code changes. The existing selector already filters Windows bundles by host architecture, so a Windows arm64 host, which today finds no bundle in the pinned release and falls through to the upstream fallback, now installs the native arm64 CPU build. An x64 Python running under emulation on Windows arm64 reports `AMD64` and keeps the x64 bundle, as before. No option was removed from `sd-cli --help` or `sd-server --help`; the new build only adds `--control-type`, `--input-frames`, `--upscale-factor` and `--vsr-window-size`. ## Testing - The sd.cpp, args, families, install, pin upgrade and download retry tests pass (1406 passed). One test and one fixture error fail on main and on this branch alike on this host, because its huggingface_hub is older than the installed diffusers expects: `test_create_causal_mask_patch_is_self_disabling_and_idempotent` and `test_selection_installs_the_cuda_build`. - Asset names: every bundle the selector can return was enumerated over Linux x86_64 / aarch64, Windows AMD64 / ARM64 and macOS arm64 / x86_64, with `auto`, `cpu`, `cuda` (no major, 12, 13), `vulkan` and `rocm`, against the real asset list of the new release. Every returned name exists in the release. The only change from the current pin is Windows ARM64 `auto` / `cpu`, which goes from no match to `win-cpu-arm64`. - SD1.5 (`v1-5-pruned-emaonly`), 512x512, 8 steps on CPU and 20 steps on CUDA, euler, cfg 7, seed 42, both builds on the same machine. Each arm repeated two or three times; every repeat was pixel-identical to the first run of its arm. LPIPS is AlexNet. Linux x86_64 CPU bundle, Xeon Platinum 8559C, 32 threads, wall time per image: | Weights | current pin | this branch | old vs new LPIPS | max pixel diff | | --- | --- | --- | --- | --- | | f16 | 34.8 / 34.8 s | 16.4 / 17.2 s | 0.0001 | 13 | | q8_0 | 31.3 / 32.4 s | 15.7 / 15.2 s | 0.007 | 118 | | q4_K | 35.5 / 35.0 s | 18.7 / 19.0 s | 0.023 | 211 | VAE decode alone went from 10 to 12 s down to 3.6 to 3.7 s. The quantized CPU renders are not bit-identical to the current pin, but they stay as close to the f16 render as before (q8_0 LPIPS to f16: 0.038 old, 0.046 new; q4_K: 0.163 old, 0.173 new). Linux CUDA 12 bundle, Colab L4, wall time per image: | Weights | current pin | this branch | old vs new LPIPS | max pixel diff | | --- | --- | --- | --- | --- | | f16 | 4.70 / 4.70 / 4.71 s | 4.70 / 4.91 / 4.73 s | 0 | 0 | | q8_0 | 7.42 / 4.92 / 4.90 s | 4.94 / 4.93 / 4.93 s | 0 | 0 | | q4_1 | 18.13 / 17.97 / 17.94 s | 18.02 / 17.97 / 18.01 s | 0.025 | 198 | | q4_K | 19.14 / 17.63 / 17.79 s | 17.74 / 17.63 / 17.61 s | 0.106 | 253 | The current pin's first q8_0 run includes a cold start. f16 and q8_0 are pixel-identical. q4_K moves, as the Q8_1 fix intends, and moves toward the f16 render: LPIPS to f16 drops from 0.240 to 0.176 (q4_1: 0.327 to 0.322). ## Not covered - macOS (Metal) and Windows were not run on hardware yet; the cross-platform staging legs (Ubuntu, macOS 15, Windows) are still to run. - The new Windows arm64 bundle is covered only by the selector test and the asset check. No Windows arm64 host ran it. - No Vulkan, ROCm or HIP render with this build, no aarch64 Linux render, and no Studio HTTP flow run (only `sd-cli` directly). - No MiniMax-H3, MOSS-Image, Qwen-Image or FLUX.2 render with this build; only SD1.5. - CPU timings are from a shared host (both arms ran back to back with the same thread count), and the CUDA timings come from one L4 VM, three runs per arm. No T4 run.
Staging mirror of unslothai#11379, opened here only to run CI and the Codex review, which do not trigger on the upstream pull request.
Base is the same merge base the upstream pull request uses, so the diff is identical. This will be closed once CI is green and the review has converged; the results will be linked from the upstream pull request. Do not merge.