+- **`GgufModelMetadata` silently dropped `UInt`/`ULong` numeric fields** — modern GGUFs (recent llama.cpp converters) store dimensions and counts as `uint32`, which the reader preserves as Kotlin `UInt`. Kotlin's unsigned types do **not** extend `kotlin.Number`, so the previous private `(value as? Number)?.toInt()` helper returned `null` for every `UInt`/`ULong` field. Result: `contextLength`, `embeddingLength`, `layerCount`, `headCount`, `vocabSize` (fallback), `bosTokenId`, and `eosTokenId` all came back `null` on real-world GGUFs and downstream loaders fell back to defaults (e.g. `blockCount=0` → zero-layer transformer). New public file `GgufFieldAccessors.kt` exposes `Map<String, Any?>` extensions (`getInt`/`getLong`/`getString`/`getIntList`/`getStringList`) covering every signed and unsigned integer type the reader can emit, plus the matching primitive arrays for the list variant. `GgufModelMetadata.from()` now routes through these public accessors; the buggy private helpers are deleted. New `GgufModelMetadataUnsignedTest` pins the contract. Non-breaking — only adds public API and fixes existing methods to return correct values. (Issue #585)
0 commit comments