Repository navigation
Conversation
There was a problem hiding this comment.
Instead of building a dummy gguf and serving it, can you please just use a URL to an example gguf from HuggingFace for testing this?
There was a problem hiding this comment.
Replaced the synthetic server fixture with a pinned Hugging Face GGUF in 5a280387. The tests cover the final byte, a normal read and a read beyond EOF: the original reader fails only the EOF regression, and all three pass with the fix.
There was a problem hiding this comment.
Could you also please add tests for https://huggingface.co/unsloth/DeepSeek-V4-Flash-0731-GGUF/blob/main/UD-IQ2_M/DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf and https://huggingface.co/unsloth/DeepSeek-V4-Flash-0731-GGUF/blob/main/UD-IQ2_M/DeepSeek-V4-Flash-0731-UD-IQ2_M-00002-of-00003.gguf?
I recall I encountered such an issue with those files and the change I did to the GgufNetworkFetchFileReader attempted to fix that, so I want to ensure it doesn't regress.
Description of change
Reading remote GGUF metadata can fail with
Expected buffer to be long enough for the requested byte rangewhen the final metadata value ends exactly at EOF and requires another buffer expansion. The requested end offset is exclusive, so equality with the received buffer length means the range is complete.Change the post-fetch check to reject only ranges extending beyond the buffer. Add public
readGgufFileInforegression coverage using a local HTTP range server and a synthetic GGUF with metadata larger than the reader's allocation increment. The tests cover exact EOF, trailing bytes, and truncated metadata.Validation on Windows with Node.js 24.21.0:
npm run test:typescriptandnpm run lint:eslintpass.The full model-dependent suite and the standalone tests requiring native bindings or live Hugging Face requests were not run.
Pull-Request Checklist
masterbranchnpm run formatto apply eslint formattingnpm run testpasses with this change — focused/offline tests, TypeScript and ESLint passed; full model-dependent suite not runFixes #0000— N/A, no existing issue found for this boundary