fstx 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. fstx-1.0.0/.gitignore +9 -0
  2. fstx-1.0.0/CMakeLists.txt +162 -0
  3. fstx-1.0.0/DESIGN.md +380 -0
  4. fstx-1.0.0/DEV.md +444 -0
  5. fstx-1.0.0/LICENSE +24 -0
  6. fstx-1.0.0/LICENSES/COPYRIGHTS +36 -0
  7. fstx-1.0.0/LICENSES/flatbuffers/LICENSE +202 -0
  8. fstx-1.0.0/LICENSES/fsst/LICENSE +21 -0
  9. fstx-1.0.0/LICENSES/highway/LICENSE +371 -0
  10. fstx-1.0.0/LICENSES/lz4/LICENSE +24 -0
  11. fstx-1.0.0/LICENSES/xxhash/LICENSE +26 -0
  12. fstx-1.0.0/LICENSES/zstd/LICENSE +30 -0
  13. fstx-1.0.0/PKG-INFO +129 -0
  14. fstx-1.0.0/README.md +99 -0
  15. fstx-1.0.0/cmake/msvc_compat.h +51 -0
  16. fstx-1.0.0/core/DESCRIPTION +2 -0
  17. fstx-1.0.0/core/arrow_abi.h +87 -0
  18. fstx-1.0.0/core/codec_ext.cpp +90 -0
  19. fstx-1.0.0/core/codec_ext.h +46 -0
  20. fstx-1.0.0/core/core_colsrc.cpp +635 -0
  21. fstx-1.0.0/core/core_file.h +75 -0
  22. fstx-1.0.0/core/core_filter.cpp +486 -0
  23. fstx-1.0.0/core/core_internal.h +210 -0
  24. fstx-1.0.0/core/core_reader.cpp +1112 -0
  25. fstx-1.0.0/core/core_util.cpp +552 -0
  26. fstx-1.0.0/core/core_writer.cpp +1183 -0
  27. fstx-1.0.0/core/enc.h +228 -0
  28. fstx-1.0.0/core/enc_num.cpp +1452 -0
  29. fstx-1.0.0/core/enc_str.cpp +663 -0
  30. fstx-1.0.0/core/fstx_core.h +309 -0
  31. fstx-1.0.0/core/fstx_footer_generated.h +763 -0
  32. fstx-1.0.0/core/kern_scalar.h +170 -0
  33. fstx-1.0.0/core/kern_test.cpp +445 -0
  34. fstx-1.0.0/core/kern_test.h +27 -0
  35. fstx-1.0.0/core/prof.cpp +111 -0
  36. fstx-1.0.0/core/prof.h +60 -0
  37. fstx-1.0.0/core/r_arrow.cpp +922 -0
  38. fstx-1.0.0/core/simd.h +126 -0
  39. fstx-1.0.0/core/simd_kernels.cpp +428 -0
  40. fstx-1.0.0/core/vendor/flatbuffers/LICENSE +202 -0
  41. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/allocator.h +68 -0
  42. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/array.h +258 -0
  43. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/base.h +491 -0
  44. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/buffer.h +225 -0
  45. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/buffer_ref.h +54 -0
  46. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/default_allocator.h +64 -0
  47. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/detached_buffer.h +121 -0
  48. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/flatbuffer_builder.h +1518 -0
  49. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/flatbuffers.h +284 -0
  50. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/stl_emulation.h +516 -0
  51. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/string.h +69 -0
  52. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/struct.h +55 -0
  53. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/table.h +263 -0
  54. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/vector.h +455 -0
  55. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/vector_downward.h +298 -0
  56. fstx-1.0.0/core/vendor/flatbuffers/include/flatbuffers/verifier.h +370 -0
  57. fstx-1.0.0/core/vendor/fsst/LICENSE +21 -0
  58. fstx-1.0.0/core/vendor/fsst/fsst.h +227 -0
  59. fstx-1.0.0/core/vendor/fsst/fsst_nosimd.cpp +7 -0
  60. fstx-1.0.0/core/vendor/fsst/libfsst.cpp +651 -0
  61. fstx-1.0.0/core/vendor/fsst/libfsst.hpp +471 -0
  62. fstx-1.0.0/core/vendor/highway/LICENSE +371 -0
  63. fstx-1.0.0/core/vendor/highway/hwy/abort.cc +96 -0
  64. fstx-1.0.0/core/vendor/highway/hwy/abort.h +11 -0
  65. fstx-1.0.0/core/vendor/highway/hwy/base.h +3231 -0
  66. fstx-1.0.0/core/vendor/highway/hwy/detect_compiler_arch.h +527 -0
  67. fstx-1.0.0/core/vendor/highway/hwy/detect_targets.h +983 -0
  68. fstx-1.0.0/core/vendor/highway/hwy/foreach_target.h +410 -0
  69. fstx-1.0.0/core/vendor/highway/hwy/highway.h +731 -0
  70. fstx-1.0.0/core/vendor/highway/hwy/highway_export.h +74 -0
  71. fstx-1.0.0/core/vendor/highway/hwy/ops/arm_neon-inl.h +10656 -0
  72. fstx-1.0.0/core/vendor/highway/hwy/ops/arm_sve-inl.h +7166 -0
  73. fstx-1.0.0/core/vendor/highway/hwy/ops/emu128-inl.h +2990 -0
  74. fstx-1.0.0/core/vendor/highway/hwy/ops/generic_ops-inl.h +8347 -0
  75. fstx-1.0.0/core/vendor/highway/hwy/ops/inside-inl.h +691 -0
  76. fstx-1.0.0/core/vendor/highway/hwy/ops/loongarch_lasx-inl.h +4686 -0
  77. fstx-1.0.0/core/vendor/highway/hwy/ops/loongarch_lsx-inl.h +5954 -0
  78. fstx-1.0.0/core/vendor/highway/hwy/ops/ppc_vsx-inl.h +7489 -0
  79. fstx-1.0.0/core/vendor/highway/hwy/ops/rvv-inl.h +6694 -0
  80. fstx-1.0.0/core/vendor/highway/hwy/ops/scalar-inl.h +2185 -0
  81. fstx-1.0.0/core/vendor/highway/hwy/ops/set_macros-inl.h +898 -0
  82. fstx-1.0.0/core/vendor/highway/hwy/ops/shared-inl.h +721 -0
  83. fstx-1.0.0/core/vendor/highway/hwy/ops/wasm_128-inl.h +5992 -0
  84. fstx-1.0.0/core/vendor/highway/hwy/ops/wasm_256-inl.h +2517 -0
  85. fstx-1.0.0/core/vendor/highway/hwy/ops/x86_128-inl.h +14151 -0
  86. fstx-1.0.0/core/vendor/highway/hwy/ops/x86_256-inl.h +8996 -0
  87. fstx-1.0.0/core/vendor/highway/hwy/ops/x86_512-inl.h +7718 -0
  88. fstx-1.0.0/core/vendor/highway/hwy/ops/x86_avx3-inl.h +501 -0
  89. fstx-1.0.0/core/vendor/highway/hwy/targets.cc +835 -0
  90. fstx-1.0.0/core/vendor/highway/hwy/targets.h +388 -0
  91. fstx-1.0.0/core/vendor/highway/hwy/x86_cpuid.h +81 -0
  92. fstx-1.0.0/core/vendor/lz4/LICENSE +24 -0
  93. fstx-1.0.0/core/vendor/lz4/lz4.c +2829 -0
  94. fstx-1.0.0/core/vendor/lz4/lz4.h +884 -0
  95. fstx-1.0.0/core/vendor/xxhash/LICENSE +26 -0
  96. fstx-1.0.0/core/vendor/xxhash/xxhash.h +7238 -0
  97. fstx-1.0.0/core/vendor/zstd/LICENSE +30 -0
  98. fstx-1.0.0/core/vendor/zstd/common/allocations.h +55 -0
  99. fstx-1.0.0/core/vendor/zstd/common/bits.h +205 -0
  100. fstx-1.0.0/core/vendor/zstd/common/bitstream.h +454 -0
  101. fstx-1.0.0/core/vendor/zstd/common/compiler.h +464 -0
  102. fstx-1.0.0/core/vendor/zstd/common/cpu.h +249 -0
  103. fstx-1.0.0/core/vendor/zstd/common/debug.c +30 -0
  104. fstx-1.0.0/core/vendor/zstd/common/debug.h +107 -0
  105. fstx-1.0.0/core/vendor/zstd/common/entropy_common.c +340 -0
  106. fstx-1.0.0/core/vendor/zstd/common/error_private.c +64 -0
  107. fstx-1.0.0/core/vendor/zstd/common/error_private.h +158 -0
  108. fstx-1.0.0/core/vendor/zstd/common/fse.h +625 -0
  109. fstx-1.0.0/core/vendor/zstd/common/fse_decompress.c +315 -0
  110. fstx-1.0.0/core/vendor/zstd/common/huf.h +277 -0
  111. fstx-1.0.0/core/vendor/zstd/common/mem.h +422 -0
  112. fstx-1.0.0/core/vendor/zstd/common/pool.c +371 -0
  113. fstx-1.0.0/core/vendor/zstd/common/pool.h +81 -0
  114. fstx-1.0.0/core/vendor/zstd/common/portability_macros.h +171 -0
  115. fstx-1.0.0/core/vendor/zstd/common/threading.c +182 -0
  116. fstx-1.0.0/core/vendor/zstd/common/threading.h +142 -0
  117. fstx-1.0.0/core/vendor/zstd/common/xxhash.c +18 -0
  118. fstx-1.0.0/core/vendor/zstd/common/xxhash.h +7094 -0
  119. fstx-1.0.0/core/vendor/zstd/common/zstd_common.c +48 -0
  120. fstx-1.0.0/core/vendor/zstd/common/zstd_deps.h +123 -0
  121. fstx-1.0.0/core/vendor/zstd/common/zstd_internal.h +324 -0
  122. fstx-1.0.0/core/vendor/zstd/common/zstd_trace.h +156 -0
  123. fstx-1.0.0/core/vendor/zstd/compress/clevels.h +134 -0
  124. fstx-1.0.0/core/vendor/zstd/compress/fse_compress.c +625 -0
  125. fstx-1.0.0/core/vendor/zstd/compress/hist.c +191 -0
  126. fstx-1.0.0/core/vendor/zstd/compress/hist.h +82 -0
  127. fstx-1.0.0/core/vendor/zstd/compress/huf_compress.c +1464 -0
  128. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress.c +7843 -0
  129. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress_internal.h +1636 -0
  130. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress_literals.c +235 -0
  131. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress_literals.h +39 -0
  132. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress_sequences.c +442 -0
  133. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress_sequences.h +55 -0
  134. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress_superblock.c +688 -0
  135. fstx-1.0.0/core/vendor/zstd/compress/zstd_compress_superblock.h +32 -0
  136. fstx-1.0.0/core/vendor/zstd/compress/zstd_cwksp.h +765 -0
  137. fstx-1.0.0/core/vendor/zstd/compress/zstd_double_fast.c +778 -0
  138. fstx-1.0.0/core/vendor/zstd/compress/zstd_double_fast.h +42 -0
  139. fstx-1.0.0/core/vendor/zstd/compress/zstd_fast.c +985 -0
  140. fstx-1.0.0/core/vendor/zstd/compress/zstd_fast.h +30 -0
  141. fstx-1.0.0/core/vendor/zstd/compress/zstd_lazy.c +2199 -0
  142. fstx-1.0.0/core/vendor/zstd/compress/zstd_lazy.h +193 -0
  143. fstx-1.0.0/core/vendor/zstd/compress/zstd_ldm.c +745 -0
  144. fstx-1.0.0/core/vendor/zstd/compress/zstd_ldm.h +109 -0
  145. fstx-1.0.0/core/vendor/zstd/compress/zstd_ldm_geartab.h +106 -0
  146. fstx-1.0.0/core/vendor/zstd/compress/zstd_opt.c +1580 -0
  147. fstx-1.0.0/core/vendor/zstd/compress/zstd_opt.h +72 -0
  148. fstx-1.0.0/core/vendor/zstd/compress/zstd_preSplit.c +238 -0
  149. fstx-1.0.0/core/vendor/zstd/compress/zstd_preSplit.h +33 -0
  150. fstx-1.0.0/core/vendor/zstd/compress/zstdmt_compress.c +1923 -0
  151. fstx-1.0.0/core/vendor/zstd/compress/zstdmt_compress.h +102 -0
  152. fstx-1.0.0/core/vendor/zstd/decompress/huf_decompress.c +1944 -0
  153. fstx-1.0.0/core/vendor/zstd/decompress/zstd_ddict.c +244 -0
  154. fstx-1.0.0/core/vendor/zstd/decompress/zstd_ddict.h +44 -0
  155. fstx-1.0.0/core/vendor/zstd/decompress/zstd_decompress.c +2410 -0
  156. fstx-1.0.0/core/vendor/zstd/decompress/zstd_decompress_block.c +2209 -0
  157. fstx-1.0.0/core/vendor/zstd/decompress/zstd_decompress_block.h +73 -0
  158. fstx-1.0.0/core/vendor/zstd/decompress/zstd_decompress_internal.h +240 -0
  159. fstx-1.0.0/core/vendor/zstd/zdict.h +481 -0
  160. fstx-1.0.0/core/vendor/zstd/zstd.h +3192 -0
  161. fstx-1.0.0/core/vendor/zstd/zstd_errors.h +107 -0
  162. fstx-1.0.0/fstx/__init__.py +75 -0
  163. fstx-1.0.0/fstx/_engine.py +11 -0
  164. fstx-1.0.0/fstx/_file.py +272 -0
  165. fstx-1.0.0/fstx/_filters.py +211 -0
  166. fstx-1.0.0/fstx/_fxa1.py +279 -0
  167. fstx-1.0.0/fstx/_meta.py +69 -0
  168. fstx-1.0.0/fstx/_read.py +679 -0
  169. fstx-1.0.0/fstx/_write.py +761 -0
  170. fstx-1.0.0/pyproject.toml +69 -0
  171. fstx-1.0.0/src/binding.h +53 -0
  172. fstx-1.0.0/src/file.cpp +137 -0
  173. fstx-1.0.0/src/module.cpp +134 -0
  174. fstx-1.0.0/src/read.cpp +166 -0
  175. fstx-1.0.0/src/write.cpp +391 -0
  176. fstx-1.0.0/tests/conftest.py +81 -0
  177. fstx-1.0.0/tests/golden/all_na.fstx +0 -0
  178. fstx-1.0.0/tests/golden/all_na.json +378 -0
  179. fstx-1.0.0/tests/golden/appended.fstx +0 -0
  180. fstx-1.0.0/tests/golden/appended.json +232 -0
  181. fstx-1.0.0/tests/golden/attrs_fxa1.fstx +0 -0
  182. fstx-1.0.0/tests/golden/attrs_fxa1.json +184 -0
  183. fstx-1.0.0/tests/golden/attrs_serialized.fstx +0 -0
  184. fstx-1.0.0/tests/golden/attrs_serialized.json +67 -0
  185. fstx-1.0.0/tests/golden/basic.fstx +0 -0
  186. fstx-1.0.0/tests/golden/basic.json +231 -0
  187. fstx-1.0.0/tests/golden/check_native.R +124 -0
  188. fstx-1.0.0/tests/golden/check_roundtrip.R +103 -0
  189. fstx-1.0.0/tests/golden/classes_blob.fstx +0 -0
  190. fstx-1.0.0/tests/golden/classes_blob.json +170 -0
  191. fstx-1.0.0/tests/golden/codec_lz4.fstx +0 -0
  192. fstx-1.0.0/tests/golden/codec_lz4.json +257 -0
  193. fstx-1.0.0/tests/golden/codec_none.fstx +0 -0
  194. fstx-1.0.0/tests/golden/codec_none.json +257 -0
  195. fstx-1.0.0/tests/golden/codec_zstd1.fstx +0 -0
  196. fstx-1.0.0/tests/golden/codec_zstd1.json +258 -0
  197. fstx-1.0.0/tests/golden/codec_zstd19.fstx +0 -0
  198. fstx-1.0.0/tests/golden/codec_zstd19.json +258 -0
  199. fstx-1.0.0/tests/golden/datatable.fstx +0 -0
  200. fstx-1.0.0/tests/golden/datatable.json +198 -0
  201. fstx-1.0.0/tests/golden/dates.fstx +0 -0
  202. fstx-1.0.0/tests/golden/dates.json +121 -0
  203. fstx-1.0.0/tests/golden/dates_odd.fstx +0 -0
  204. fstx-1.0.0/tests/golden/dates_odd.json +78 -0
  205. fstx-1.0.0/tests/golden/datetimes.fstx +0 -0
  206. fstx-1.0.0/tests/golden/datetimes.json +380 -0
  207. fstx-1.0.0/tests/golden/datetimes_odd.fstx +0 -0
  208. fstx-1.0.0/tests/golden/datetimes_odd.json +142 -0
  209. fstx-1.0.0/tests/golden/datetimes_subus.fstx +0 -0
  210. fstx-1.0.0/tests/golden/datetimes_subus.json +77 -0
  211. fstx-1.0.0/tests/golden/difftime.fstx +0 -0
  212. fstx-1.0.0/tests/golden/difftime.json +316 -0
  213. fstx-1.0.0/tests/golden/empty_0x0.fstx +0 -0
  214. fstx-1.0.0/tests/golden/empty_0x0.json +23 -0
  215. fstx-1.0.0/tests/golden/factor_na_level.fstx +0 -0
  216. fstx-1.0.0/tests/golden/factor_na_level.json +63 -0
  217. fstx-1.0.0/tests/golden/factors.fstx +0 -0
  218. fstx-1.0.0/tests/golden/factors.json +265 -0
  219. fstx-1.0.0/tests/golden/format-1.0.json +6534 -0
  220. fstx-1.0.0/tests/golden/full/cd.json +1 -0
  221. fstx-1.0.0/tests/golden/full/strings_many.json +1 -0
  222. fstx-1.0.0/tests/golden/integer64.fstx +0 -0
  223. fstx-1.0.0/tests/golden/integer64.json +80 -0
  224. fstx-1.0.0/tests/golden/make_full_values.R +37 -0
  225. fstx-1.0.0/tests/golden/make_golden.R +494 -0
  226. fstx-1.0.0/tests/golden/manifest.json +288 -0
  227. fstx-1.0.0/tests/golden/names.fstx +0 -0
  228. fstx-1.0.0/tests/golden/names.json +213 -0
  229. fstx-1.0.0/tests/golden/profile_balanced.fstx +0 -0
  230. fstx-1.0.0/tests/golden/profile_balanced.json +257 -0
  231. fstx-1.0.0/tests/golden/profile_fast.fstx +0 -0
  232. fstx-1.0.0/tests/golden/profile_fast.json +257 -0
  233. fstx-1.0.0/tests/golden/profile_small.fstx +0 -0
  234. fstx-1.0.0/tests/golden/profile_small.json +257 -0
  235. fstx-1.0.0/tests/golden/rmatch/check_rmatch.R +88 -0
  236. fstx-1.0.0/tests/golden/rmatch/make_rmatch.R +98 -0
  237. fstx-1.0.0/tests/golden/rmatch/rmatch_dates.fstx +0 -0
  238. fstx-1.0.0/tests/golden/rmatch/rmatch_dates.view.json +50 -0
  239. fstx-1.0.0/tests/golden/rmatch/rmatch_factors.fstx +0 -0
  240. fstx-1.0.0/tests/golden/rmatch/rmatch_factors.view.json +204 -0
  241. fstx-1.0.0/tests/golden/rmatch/rmatch_int64.fstx +0 -0
  242. fstx-1.0.0/tests/golden/rmatch/rmatch_int64.view.json +76 -0
  243. fstx-1.0.0/tests/golden/rmatch/rmatch_microseconds.fstx +0 -0
  244. fstx-1.0.0/tests/golden/rmatch/rmatch_microseconds.view.json +30 -0
  245. fstx-1.0.0/tests/golden/rmatch/rmatch_na.fstx +0 -0
  246. fstx-1.0.0/tests/golden/rmatch/rmatch_na.view.json +246 -0
  247. fstx-1.0.0/tests/golden/rmatch/rmatch_strings.fstx +0 -0
  248. fstx-1.0.0/tests/golden/rmatch/rmatch_strings.view.json +36 -0
  249. fstx-1.0.0/tests/golden/rmatch/rmatch_times.fstx +0 -0
  250. fstx-1.0.0/tests/golden/rmatch/rmatch_times.view.json +164 -0
  251. fstx-1.0.0/tests/golden/rmatch/rview.R +103 -0
  252. fstx-1.0.0/tests/golden/rownames_char.fstx +0 -0
  253. fstx-1.0.0/tests/golden/rownames_char.json +61 -0
  254. fstx-1.0.0/tests/golden/rownames_int.fstx +0 -0
  255. fstx-1.0.0/tests/golden/rownames_int.json +91 -0
  256. fstx-1.0.0/tests/golden/strings_indic.fstx +0 -0
  257. fstx-1.0.0/tests/golden/strings_indic.json +126 -0
  258. fstx-1.0.0/tests/golden/strings_invalid_utf8.fstx +0 -0
  259. fstx-1.0.0/tests/golden/strings_invalid_utf8.json +63 -0
  260. fstx-1.0.0/tests/golden/strings_latin1.fstx +0 -0
  261. fstx-1.0.0/tests/golden/strings_latin1.json +57 -0
  262. fstx-1.0.0/tests/golden/strings_long.fstx +0 -0
  263. fstx-1.0.0/tests/golden/strings_long.json +62 -0
  264. fstx-1.0.0/tests/golden/strings_many.fstx +0 -0
  265. fstx-1.0.0/tests/golden/strings_many.json +115 -0
  266. fstx-1.0.0/tests/golden/tibble.fstx +0 -0
  267. fstx-1.0.0/tests/golden/tibble.json +99 -0
  268. fstx-1.0.0/tests/golden/zero_cols_5rows.fstx +0 -0
  269. fstx-1.0.0/tests/golden/zero_cols_5rows.json +29 -0
  270. fstx-1.0.0/tests/golden/zero_rows.fstx +0 -0
  271. fstx-1.0.0/tests/golden/zero_rows.json +216 -0
  272. fstx-1.0.0/tests/golden_tables.py +113 -0
  273. fstx-1.0.0/tests/rview.py +277 -0
  274. fstx-1.0.0/tests/test_build.py +40 -0
  275. fstx-1.0.0/tests/test_metadata.py +154 -0
  276. fstx-1.0.0/tests/test_read.py +844 -0
  277. fstx-1.0.0/tests/test_rmatch.py +535 -0
  278. fstx-1.0.0/tests/test_roundtrip.py +400 -0
  279. fstx-1.0.0/tests/test_write.py +717 -0
  280. fstx-1.0.0/tools/bench_py.py +115 -0
  281. fstx-1.0.0/tools/bench_r.R +21 -0
  282. fstx-1.0.0/tools/make_core.py +61 -0
fstx-1.0.0/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ build/
2
+ dist/
3
+ core/
4
+ *.egg-info/
5
+ __pycache__/
6
+ .pytest_cache/
7
+ *.pyd
8
+ *.so
9
+ tests/golden/from_python/
@@ -0,0 +1,162 @@
1
+ # fstx for Python: the FST-X engine (../src, no R code) plus the nanobind module fstx._core.
2
+ # Built through scikit-build-core (pip install ./python); DEV.md has the commands.
3
+ cmake_minimum_required(VERSION 3.21)
4
+ project(fstx_python LANGUAGES C CXX)
5
+
6
+ # ---------------------------------------------------------------- where the engine is
7
+ # In the git tree it is ../src. An sdist can carry its own copy in python/core (DEV.md, wheels).
8
+ set(FSTX_CORE_DIR "" CACHE PATH "folder with the fstx engine sources (default: ../src)")
9
+ if(NOT FSTX_CORE_DIR)
10
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/core/fstx_core.h")
11
+ set(FSTX_CORE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/core")
12
+ else()
13
+ set(FSTX_CORE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../src")
14
+ endif()
15
+ endif()
16
+ get_filename_component(FSTX_CORE_DIR "${FSTX_CORE_DIR}" ABSOLUTE)
17
+ if(NOT EXISTS "${FSTX_CORE_DIR}/fstx_core.h")
18
+ message(FATAL_ERROR "fstx engine sources not found in ${FSTX_CORE_DIR}")
19
+ endif()
20
+
21
+ # The engine version written into every file's created_by: DESCRIPTION is the one source, as in ./configure.
22
+ set(FSTX_CORE_VERSION "" CACHE STRING "engine version (default: read from DESCRIPTION)")
23
+ if(NOT FSTX_CORE_VERSION)
24
+ foreach(d "${FSTX_CORE_DIR}/../DESCRIPTION" "${FSTX_CORE_DIR}/DESCRIPTION")
25
+ if(NOT FSTX_CORE_VERSION AND EXISTS "${d}")
26
+ file(STRINGS "${d}" _ver REGEX "^Version:")
27
+ string(REGEX REPLACE "^Version:[ \t]*([^ \t\r]+).*$" "\\1" FSTX_CORE_VERSION "${_ver}")
28
+ endif()
29
+ endforeach()
30
+ endif()
31
+ if(NOT FSTX_CORE_VERSION)
32
+ message(FATAL_ERROR "cannot find the engine version (DESCRIPTION); pass -DFSTX_CORE_VERSION=x.y.z")
33
+ endif()
34
+ message(STATUS "fstx engine ${FSTX_CORE_VERSION} from ${FSTX_CORE_DIR}")
35
+
36
+ set(CMAKE_CXX_STANDARD 17)
37
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
38
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
39
+ set(CMAKE_C_VISIBILITY_PRESET hidden)
40
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
41
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
42
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
43
+ set(CMAKE_BUILD_TYPE Release)
44
+ endif()
45
+
46
+ # ---------------------------------------------------------------- the engine: a static library, no R glue
47
+ # The list is OBJECTS of src/Makevars.in minus the R glue (r_*.cpp, cpp11.cpp). prof.cpp has no R code (its counters
48
+ # are compiled out unless FSTX_PROF is defined) and the engine calls into it, so it stays.
49
+ set(V "${FSTX_CORE_DIR}/vendor")
50
+ set(FSTX_VENDOR_SOURCES
51
+ ${V}/zstd/common/debug.c ${V}/zstd/common/entropy_common.c ${V}/zstd/common/error_private.c
52
+ ${V}/zstd/common/fse_decompress.c ${V}/zstd/common/pool.c ${V}/zstd/common/threading.c
53
+ ${V}/zstd/common/xxhash.c ${V}/zstd/common/zstd_common.c
54
+ ${V}/zstd/compress/fse_compress.c ${V}/zstd/compress/hist.c ${V}/zstd/compress/huf_compress.c
55
+ ${V}/zstd/compress/zstd_compress.c ${V}/zstd/compress/zstd_compress_literals.c
56
+ ${V}/zstd/compress/zstd_compress_sequences.c ${V}/zstd/compress/zstd_compress_superblock.c
57
+ ${V}/zstd/compress/zstd_double_fast.c ${V}/zstd/compress/zstd_fast.c ${V}/zstd/compress/zstd_lazy.c
58
+ ${V}/zstd/compress/zstd_ldm.c ${V}/zstd/compress/zstd_opt.c ${V}/zstd/compress/zstd_preSplit.c
59
+ ${V}/zstd/compress/zstdmt_compress.c
60
+ ${V}/zstd/decompress/huf_decompress.c ${V}/zstd/decompress/zstd_ddict.c
61
+ ${V}/zstd/decompress/zstd_decompress.c ${V}/zstd/decompress/zstd_decompress_block.c
62
+ ${V}/lz4/lz4.c
63
+ ${V}/fsst/libfsst.cpp ${V}/fsst/fsst_nosimd.cpp
64
+ ${V}/highway/hwy/targets.cc ${V}/highway/hwy/abort.cc)
65
+ set(FSTX_ENGINE_SOURCES
66
+ ${FSTX_CORE_DIR}/core_util.cpp ${FSTX_CORE_DIR}/core_writer.cpp ${FSTX_CORE_DIR}/core_reader.cpp
67
+ ${FSTX_CORE_DIR}/core_filter.cpp ${FSTX_CORE_DIR}/core_colsrc.cpp
68
+ ${FSTX_CORE_DIR}/enc_num.cpp ${FSTX_CORE_DIR}/enc_str.cpp
69
+ ${FSTX_CORE_DIR}/codec_ext.cpp ${FSTX_CORE_DIR}/simd_kernels.cpp ${FSTX_CORE_DIR}/kern_test.cpp
70
+ ${FSTX_CORE_DIR}/prof.cpp
71
+ ${FSTX_CORE_DIR}/r_arrow.cpp)
72
+ # r_arrow.cpp is the Arrow C stream (fstx_arrow_stream_open, arrow_abi.h) with R glue at its end; the glue is
73
+ # compiled out with FSTX_ARROW_NO_R, as tools/fuzz does. It is the one r_*.cpp file in this build.
74
+ set_source_files_properties(${FSTX_CORE_DIR}/r_arrow.cpp PROPERTIES COMPILE_DEFINITIONS FSTX_ARROW_NO_R)
75
+
76
+ add_library(fstx_engine STATIC ${FSTX_ENGINE_SOURCES} ${FSTX_VENDOR_SOURCES})
77
+ target_include_directories(fstx_engine PUBLIC
78
+ "${FSTX_CORE_DIR}" "${V}/flatbuffers/include" "${V}/fsst" "${V}/highway")
79
+ # The preprocessor flags of PKG_CPPFLAGS in src/Makevars.in. 25956824 = the Highway targets left out
80
+ # (x86: SSSE3 and every AVX-512 flavour, so SSE2 / SSE4 / AVX2 stay; ARM: the SVE family, NEON stays).
81
+ target_compile_definitions(fstx_engine PUBLIC
82
+ ZSTD_DISABLE_ASM
83
+ HWY_DISABLED_TARGETS=25956824
84
+ FSTX_VERSION=${FSTX_CORE_VERSION})
85
+
86
+ set(FSTX_IS_MSVC_CL OFF) # cl.exe itself
87
+ set(FSTX_IS_CLANG_CL OFF) # clang behind the MSVC command line
88
+ if(MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
89
+ set(FSTX_IS_CLANG_CL ON)
90
+ elseif(MSVC)
91
+ set(FSTX_IS_MSVC_CL ON)
92
+ endif()
93
+
94
+ # No fused multiply-add anywhere, so SIMD and plain code round the same and files are byte-identical on
95
+ # every CPU (what ./configure does with -ffp-contract=off).
96
+ include(CheckCXXCompilerFlag)
97
+ if(FSTX_IS_MSVC_CL)
98
+ # /fp:precise is cl's default and VS 2022 does not contract under it; /fp:contract- says so out loud.
99
+ target_compile_options(fstx_engine PRIVATE /fp:precise /bigobj)
100
+ check_cxx_compiler_flag("/fp:contract-" FSTX_HAS_FP_CONTRACT_OFF)
101
+ if(FSTX_HAS_FP_CONTRACT_OFF)
102
+ target_compile_options(fstx_engine PRIVATE /fp:contract-)
103
+ endif()
104
+ # cl.exe has no __builtin_ctzll & co and no __attribute__: cmake/msvc_compat.h supplies them, included
105
+ # ahead of every engine and vendor source (and of whatever links the engine and includes its headers).
106
+ target_compile_options(fstx_engine PUBLIC "/FI${CMAKE_CURRENT_SOURCE_DIR}/cmake/msvc_compat.h" /utf-8)
107
+ target_compile_definitions(fstx_engine PUBLIC _CRT_SECURE_NO_WARNINGS)
108
+ elseif(FSTX_IS_CLANG_CL)
109
+ target_compile_options(fstx_engine PRIVATE /clang:-ffp-contract=off)
110
+ target_compile_options(fstx_engine PUBLIC /utf-8)
111
+ target_compile_definitions(fstx_engine PUBLIC _CRT_SECURE_NO_WARNINGS)
112
+ else()
113
+ check_cxx_compiler_flag("-ffp-contract=off" FSTX_HAS_FP_CONTRACT_OFF)
114
+ if(FSTX_HAS_FP_CONTRACT_OFF)
115
+ target_compile_options(fstx_engine PRIVATE -ffp-contract=off)
116
+ else()
117
+ message(WARNING "the compiler does not take -ffp-contract=off: files may differ between CPUs")
118
+ endif()
119
+ # GCC on Win64 (MinGW) only: GCC bug 54412, the stack is not aligned for 32-byte vectors, so the
120
+ # assembler is told to write unaligned moves (configure.win). cl and clang align the stack themselves.
121
+ if(MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|x86_64")
122
+ target_compile_options(fstx_engine PRIVATE -Wa,-muse-unaligned-vector-move)
123
+ endif()
124
+ endif()
125
+
126
+ find_package(Threads REQUIRED)
127
+ target_link_libraries(fstx_engine PUBLIC Threads::Threads)
128
+
129
+ # ---------------------------------------------------------------- coretest (optional): the engine's own test program
130
+ option(FSTX_BUILD_CORETEST "build tools/coretest (engine self-test, no Python)" OFF)
131
+ if(FSTX_BUILD_CORETEST)
132
+ add_executable(coretest "${FSTX_CORE_DIR}/../tools/coretest/coretest.cpp")
133
+ target_link_libraries(coretest PRIVATE fstx_engine)
134
+ endif()
135
+
136
+ # ---------------------------------------------------------------- the Python module fstx._core
137
+ option(FSTX_BUILD_PYTHON "build the Python extension fstx._core" ON)
138
+ if(FSTX_BUILD_PYTHON)
139
+ if(CMAKE_VERSION VERSION_LESS 3.26)
140
+ find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module)
141
+ else()
142
+ find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module
143
+ OPTIONAL_COMPONENTS Development.SABIModule)
144
+ endif()
145
+ if(NOT nanobind_DIR AND NOT nanobind_ROOT)
146
+ execute_process(COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
147
+ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE nanobind_ROOT)
148
+ endif()
149
+ find_package(nanobind CONFIG REQUIRED)
150
+
151
+ # One .cpp per area, each with an init_<area>(nb::module_&) called from module.cpp (see src/binding.h).
152
+ # STABLE_ABI: abi3 on CPython 3.12+, an ordinary module on 3.10 and 3.11.
153
+ nanobind_add_module(_core STABLE_ABI NB_STATIC
154
+ src/module.cpp
155
+ src/file.cpp
156
+ src/write.cpp
157
+ src/read.cpp)
158
+ target_link_libraries(_core PRIVATE fstx_engine)
159
+ target_compile_definitions(_core PRIVATE
160
+ FSTX_PY_COMPILER="${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
161
+ install(TARGETS _core LIBRARY DESTINATION fstx RUNTIME DESTINATION fstx)
162
+ endif()
fstx-1.0.0/DESIGN.md ADDED
@@ -0,0 +1,380 @@
1
+ # fstx for Python: design
2
+
3
+ Status: proposal, 17 Nov 2026, for the Python port of fstx 1.0.0 (file format 1.0, format version 3). Covers the
4
+ Python API, how every R type maps to and from Arrow, what a round trip R -> Python -> R keeps, and the golden
5
+ files that test it (`python/tests/golden/`). The build itself (packaging, compiler setup) is a separate piece of
6
+ work on branch `python`.
7
+
8
+ Facts below marked "checked" were run on 17 Nov 2026 with R 4.5.1 + fstx 1.0.0 and Python 3.14.4 + pyarrow
9
+ 25.0.1 + pandas 3.0.2. Everything else is the proposal.
10
+
11
+ ## 1. Principles
12
+
13
+ 1. **pyarrow.Table is the core type.** Every read returns one; every write takes one (or anything that converts
14
+ to one: a pandas or polars DataFrame, any object with `__arrow_c_stream__`). pandas and polars are helpers on
15
+ top, not separate code paths.
16
+ 2. **Reuse the C++ engine as it is.** The binding calls the plain C API in `src/fstx_core.h` (open, plan, read,
17
+ colsrc, filter, writer, compact) and the Arrow stream in `src/r_arrow.cpp`, which already builds without R
18
+ (`-DFSTX_ARROW_NO_R`) and uses only the Arrow C ABI of `src/arrow_abi.h`. pyarrow imports that stream with
19
+ `pa.RecordBatchReader._import_from_c` (or the PyCapsule `__arrow_c_stream__` protocol). No R code, no second
20
+ decoder. The file format does not change: a file written by Python is an ordinary fstx 1.0 file.
21
+ 3. **Keep R's meaning in Arrow metadata.** Arrow cannot say "Date stored as double", "POSIXct with tzone \"\"",
22
+ "integer64", "factor with an NA level" or "data.table key". The reader puts what the file stores into field and
23
+ schema metadata (section 4); the writer reads it back. With the metadata intact, R -> Python -> R is identical()
24
+ for every case in section 3 that is not marked lossy.
25
+ 4. **Never run R code.** Attribute blobs in R serialization (spec 9.4) are never decoded in Python; they travel as
26
+ opaque bytes. FXA1 blobs are decoded and encoded in Python (a few dozen lines; spec 9.4 is complete).
27
+ 5. **Refuse rather than guess.** A type with no fstx 1.0 storage (binary, list, struct, decimal, ...) is an error
28
+ that names the column, as `write_fstx()` in R does.
29
+
30
+ ## 2. API
31
+
32
+ Module `fstx`. Rows are **0-based** in Python (R's are 1-based); everything else follows the R names.
33
+
34
+ ```python
35
+ import fstx
36
+
37
+ t = fstx.read_fstx(path, columns=None, rows=None, filters=None, *,
38
+ threads=None, verify=True, as_factor=False, attributes=True,
39
+ datetimes="arrow", invalid_utf8="replace") # -> pyarrow.Table
40
+
41
+ fstx.write_fstx(data, path, *, profile="balanced", compress=None, level=None,
42
+ threads=None, append=False, int64="auto") # -> None
43
+
44
+ m = fstx.metadata(path) # FileMeta: nrow, ncol, row_groups, pages, profile, format_version,
45
+ # file_size, schema (pyarrow.Schema with the metadata of section 4),
46
+ # columns (list of ColumnMeta: name, phys, logical, tzone, levels,
47
+ # compressed_bytes, raw_bytes, pages, r_class)
48
+ p = fstx.pages(path) # pyarrow.Table, one row per page, as R's fstx_pages()
49
+
50
+ with fstx.open(path) as f: # the lazy form (R: read_fstx(lazy = TRUE))
51
+ f.schema, f.num_rows
52
+ f.read(columns=..., rows=..., filters=...) # -> pyarrow.Table
53
+ f.to_batches(columns=None, batch_rows=None, filters=None) # -> pyarrow.RecordBatchReader
54
+ # f.__arrow_c_stream__(): polars.scan / duckdb read it lazily, a row group at a time
55
+
56
+ fstx.which(path, filters, start=0, stop=None) # numpy uint64 array of 0-based matching rows
57
+ fstx.explain(path, filters, start=0, stop=None, exact=False) # dict, as R's fstx_explain()
58
+ fstx.compact(path, merge=False, threads=None)
59
+
60
+ fstx.to_pandas(table) # R-aware: nullable dtypes, row names -> index, metadata kept in df.attrs
61
+ fstx.to_polars(table) # polars.from_arrow plus the same casts
62
+ ```
63
+
64
+ Arguments, against R's `read_fstx()` / `write_fstx()`:
65
+
66
+ | R | Python | note |
67
+ |---|---|---|
68
+ | `columns =` names or 1-based positions | `columns=` names or 0-based positions | duplicate names: first match, as R |
69
+ | `from =, to =` (1-based, inclusive) | `rows=slice(start, stop)` or `range` | half-open, 0-based |
70
+ | `rows =` (1-based, any order, repeats) | `rows=` list / numpy array of 0-based ints | same engine call (`fstx_plan_create_rows`) |
71
+ | `where = x > 5 & y == "a"` | `filters=[("x", ">", 5), ("y", "==", "a")]` | AND only, as R. Ops `== != < <= > >= in is_null not_null`; `between` is two terms. Values converted as R's `.term_pred()` does: strings for Date / timestamp columns parse as ISO dates, factor values are level names, `<` on a factor needs `ordered`, `None` in a comparison matches nothing, `in` may hold `None` (NA rows) and `nan` (NaN rows). integer64, difftime and other classed columns cannot be filtered (R refuses them too) |
72
+ | `lazy = TRUE` | `fstx.open()` | no ALTREP in Python; the open file pages through mmap |
73
+ | `strings = "auto" / "deferred" / "eager"` | not ported | R string-cache details; Python always builds Arrow strings |
74
+ | `as_factor = TRUE / names` | same | dictionary-coded string columns come back as `dictionary<int32, string>`; levels sorted as R |
75
+ | `attributes = FALSE` | same | drops the opaque R-serialization blobs from the metadata (FXA1 stays) |
76
+ | `verify`, `threads` | same | `threads=None` = all cores |
77
+ | `profile`, `compress`, `level`, `append` | same | `compress` in `"zstd"`, `"lz4"`, `"none"`. **pcodec does not exist in fstx 1.0**: codec 4 is reserved and refused |
78
+ | `options(fstx.verify_nulls = TRUE)` | `fstx.set_options(verify_nulls=True)` | |
79
+ | - | `datetimes="arrow"` / `"float"` | `"float"` returns Date / POSIXct as their stored float64 / int32 (exact; section 3.4) |
80
+ | - | `invalid_utf8="replace"` / `"error"` / `"binary"` | section 3.3 |
81
+ | - | `int64="auto"` / `"integer64"` / `"double"` | section 3.6 |
82
+
83
+ Character columns come back as `string` (or `large_string` when the column's text could pass 2 GB), never as
84
+ dictionary unless `as_factor` asks: R's Arrow stream switches to dictionary when every page is dictionary-coded,
85
+ which makes the schema depend on the data. Python decodes those to plain strings so one file always gives one
86
+ schema.
87
+
88
+ ## 3. Type mapping
89
+
90
+ Each row: how R holds it, how the file stores it (spec 4.2: phys / logical / levels / tzone, plus the attribute
91
+ blob "attrs" of spec 9.4), what Python returns, what Python writes back, and whether R -> Python -> R gives an
92
+ identical() table through pyarrow ("RT"). "meta" = the field metadata of section 4. The golden case that tests the
93
+ row is in brackets.
94
+
95
+ ### 3.1 Logical, integer, double
96
+
97
+ | R | file | Python read | Python write back | RT / lost |
98
+ |---|---|---|---|---|
99
+ | logical, NA | phys 2 (int32 0/1, NA = 0x80000000) | `bool`, NA -> null | `bool` -> logical | yes [basic] |
100
+ | integer, NA | phys 0 int32, NA = 0x80000000 | `int32`, NA -> null | `int32` -> integer. A non-null INT32_MIN cannot be stored (it is R's NA): error | yes [basic] |
101
+ | double | phys 1 float64 | `double` | `double` -> double, bits kept | yes [basic] |
102
+ | double NA_real_ (0x7FF00000000007A2) | missing-value block marks it | null | null -> NA_real_ | yes |
103
+ | double NA_real_ + 1 (quiet NA, 0x7FF80000000007A2) | stored as a value, counted in null_count (spec 4.5) | null (any NaN whose low word is 1954, as R and fstx's Arrow stream) | NA_real_ 0x7FF00000000007A2 | identical() TRUE, bits differ (checked: identical() ignores the payload) [basic] |
104
+ | NaN (0x7FF8000000000000) | a value, not missing | `nan` value, not null | `nan` -> NaN | yes through pyarrow. **Through pandas, no**: pandas has one NaN for both, and `from_pandas` turns NaN into null, so R's NaN comes back NA [basic] |
105
+ | -0, Inf, -Inf, subnormal | values | same bits | same bits | yes [basic] |
106
+
107
+ ### 3.2 Characters
108
+
109
+ | R | file | Python read | Python write back | RT / lost |
110
+ |---|---|---|---|---|
111
+ | UTF-8 / ASCII strings, `""`, NA | phys 3, UTF-8; NA in the missing-value block, `""` is length 0 not missing | `string`, NA -> null, `""` -> `""` | `string` / `large_string` / `string_view` -> character | yes [basic, strings_*] |
112
+ | non-ASCII in Indian scripts (Devanagari, Bengali, Tamil, Telugu, Kannada, Malayalam, Gujarati, Gurmukhi, Odia, Urdu, ZWJ conjuncts, 4-byte characters) | UTF-8 bytes | same text | same bytes | yes [strings_indic] |
113
+ | latin1-marked | converted to UTF-8 by the R writer | UTF-8 text | UTF-8 | identical() TRUE; R marks them UTF-8 after any read, Python or not [strings_latin1] |
114
+ | "native" | UTF-8 locale: stored as is; other locales: converted to UTF-8 | text | UTF-8 | as latin1 |
115
+ | "bytes"-marked | **refused by the R writer** (checked: "strings marked as 'bytes' encoding, which cannot be stored") | - | - | no file holds them |
116
+ | not valid UTF-8 (native strings with bad bytes in a UTF-8 session) | **stored as they are** (spec 9 rule 7; checked) | `invalid_utf8="replace"` (default): bad bytes -> U+FFFD, one warning per column; `"error"`: refuse; `"binary"`: the column comes back as `binary`, bytes kept. pyarrow must never hold invalid UTF-8 in a `string` array (checked: casting it fails; later ops would too) | `binary` columns with meta from fstx -> character with the same bytes; other `binary` -> refused | **no** by default; yes with `"binary"` [strings_invalid_utf8] |
117
+ | long strings (over 64 KB) | as any string; the writer refuses strings over 1 GB | `string` | same; over 1 GB refused | yes [strings_long] |
118
+ | NUL byte | impossible in R; corrupt in a file | - | refused | - |
119
+
120
+ ### 3.3 Factors
121
+
122
+ | R | file | Python read | Python write back | RT / lost |
123
+ |---|---|---|---|---|
124
+ | factor | logical 1, phys 0: 1-based codes, NA code = missing, `levels` in the footer | `dictionary<indices=int32, values=string, ordered=0>`; codes - 1; NA -> null | dictionary -> factor; levels = dictionary values in order | yes [factors] |
125
+ | ordered factor | same + `ordered` | same, `ordered=1` | ordered dictionary -> ordered factor | yes [factors] |
126
+ | unused levels | levels kept | kept in the dictionary | kept | yes [factors] |
127
+ | no levels at all | levels empty | empty dictionary, all null | same | yes [all_na] |
128
+ | NA as a level (`exclude = NULL`) | **not native**: the R writer only stores levels without NA natively, so this is phys 0 with `levels` and `class` in the FXA1 blob (checked) | dictionary whose values hold a null; a code pointing at it is a value, not a null (checked: pyarrow allows this) | dictionary with a null value -> int32 + FXA1 blob {levels with NA, class}, as R does | yes through pyarrow. **pandas cannot hold it** (checked: "Categorical categories cannot be null"); `fstx.to_pandas` turns the column into strings with a warning [factor_na_level] |
129
+ | class `c("myfac", "factor")` | not native: int32 + blob | dictionary (any class vector containing "factor" with string levels); class in meta | class from meta | yes with meta [classes_blob] |
130
+ | pandas Categorical / polars Categorical, Enum | - | - | factor (ordered when ordered); dictionary of non-strings -> written as its decoded values | - |
131
+
132
+ ### 3.4 Dates and times
133
+
134
+ | R | file | Python read (`datetimes="arrow"`) | Python write back | RT / lost |
135
+ |---|---|---|---|---|
136
+ | Date as double (`as.Date()`) | logical 2, phys 1 (days) | `date32[day]`; meta phys = double | date32 -> Date **as double** (what `as.Date()` gives) unless meta says integer | yes [dates] |
137
+ | Date as integer | logical 2, phys 0 | `date32[day]`; meta phys = integer | integer if meta says so | yes only through meta: date32 alone cannot tell, and identical() sees integer vs double (checked) [dates] |
138
+ | Date fractional (1.5), Inf, -Inf, NaN | double values | date32 floors fractions (as R prints them; as fstx's Arrow stream); Inf / -Inf / NaN -> null | null -> NA | **no** (Inf, NaN -> NA, 1.5 -> 1). Exact with `datetimes="float"` [dates_odd] |
139
+ | years 1 to 9999 | double days | date32 holds them | - | yes; pandas keeps them as `datetime.date` objects (checked), `datetime64[ns]` cannot |
140
+ | POSIXct with tzone | logical 3, phys 1 seconds, `tzone` | `timestamp[us, tz=<tzone>]`, value = round(seconds x 1e6) half-even (as the stream) | timestamp -> POSIXct double seconds = us / 1e6, tzone = tz | yes when the seconds are whole microseconds [datetimes: UTC, Asia/Kolkata, America/New_York] |
141
+ | POSIXct, tzone `""` | `tzone` present and empty (checked) | `timestamp[us]` (naive); meta `tzone: ""` | tzone `""` from meta | yes with meta [datetimes] |
142
+ | POSIXct, no tzone attribute | `tzone` absent (checked) | `timestamp[us]` (naive); meta says absent | no tzone from meta | yes with meta [datetimes] |
143
+ | sub-microsecond seconds (`Sys.time()`) | float64 | rounded to the microsecond | us / 1e6 | **no**: last bits change (checked with the simulated round trip in check_roundtrip.R). Exact with `datetimes="float"` [datetimes_subus] |
144
+ | POSIXct Inf, -Inf, NaN | values | null | NA | **no** [datetimes_odd] |
145
+ | POSIXct stored as integer, or with a 2-value tzone, or extra classes | not native: int32 / double + blob | `timestamp[us, tz=tzone[1]]` (class contains POSIXct); meta keeps phys and class | from meta | yes with meta [datetimes_odd, classes_blob] |
146
+ | POSIXlt | a list: R's `data.frame()` turns it into POSIXct first; a list column is refused | - | - | - |
147
+ | difftime (secs, mins, hours, days, weeks), hms | double + blob {class, units} | `double`; meta has class and units. `fstx.to_pandas` keeps float (an option gives `timedelta64`) | double + blob from meta | yes [difftime]; via timedelta64: units become secs |
148
+
149
+ Naive timestamps written from Python with no fstx meta (data that never came from R) get tzone `"UTC"`, so R
150
+ shows the same clock time Python showed. R's own meaning of "no tzone" is "an instant shown in the session's local
151
+ time", which Python has no equivalent for.
152
+
153
+ Fixed UTC offsets (added 18 Nov 2026, Harsh's "do 1-5"). Arrow writes a fixed offset as the time zone `"+05:30"`;
154
+ R reads that string as a POSIX TZ rule, where the sign counts the other way (UTC-05:30), and shows the time 11 hours
155
+ off. The writer stores such a zone as R's tzone in POSIX form with a name in angle brackets, `"<+0530>-05:30"`
156
+ (`"-03:00"` -> `"<-0300>+03:00"`, `"+00:00"` -> `"<+0000>-00:00"`), and the reader turns exactly that form back
157
+ into `"+05:30"`, so Python round-trips. Checked on R 4.5.1 and R 4.6.1 (Windows): `format()`,
158
+ `as.POSIXlt()$hour` / `$gmtoff` and an R write -> read are right for +05:30, -03:00, +00:00, +05:45, -09:30,
159
+ +14:00, -12:00 and +01:00 between the years 1900 and 9999; R warns "unknown timezone '<+0530>-05:30'" whenever it
160
+ formats such a column (its zone database has no file of that name, so it falls back to the POSIX rule, which is
161
+ right). Named zones (Asia/Kolkata, UTC, ...) are unchanged. The metadata contract is unchanged: `fstx.r`'s
162
+ `tzone` is what the file holds (the POSIX form); only the Arrow type carries `"+05:30"`. A file that holds
163
+ `"+05:30"` itself (written by R, or by this package before 18 Nov 2026) reads as `"+05:30"` and is written back as
164
+ it was. pandas turns a zero offset into UTC; with the metadata the writer keeps the file's `"<+0000>-00:00"`.
165
+ polars has no fixed offsets: `fstx.to_polars` returns them as UTC (same instants) with a warning (section 8).
166
+
167
+ ### 3.5 integer64 (bit64)
168
+
169
+ | R | file | Python read | Python write back | RT / lost |
170
+ |---|---|---|---|---|
171
+ | integer64, NA = INT64_MIN | **phys 1 double page** holding the int64 bit patterns, `class = "integer64"` in the FXA1 blob (checked) | `int64`, made by reinterpreting the decoded float64 bits; null **only** where the bits are INT64_MIN. The page's missing-value block and null_count must be ignored for this column | int64 -> double page of the same bits + blob `class = "integer64"` | yes [integer64] |
172
+ | values whose bits are R's NA_real_ (9218868437227407266), quiet NA (9221120237041092514), Inf or NaN | the R writer marks the NA_real_ one missing and counts both NA patterns in null_count (checked: page nulls = 2 for 1 real NA) | must come back as these numbers, not null | same bits | yes, only if the reader ignores validity as above [integer64] |
173
+ | filters, page min / max | statistics are of the doubles, meaningless here | filters on integer64 refused (as R) | the writer's statistics for these pages are wrong by design; harmless while filters refuse the column | - |
174
+
175
+ ### 3.6 Arrow / pandas types that do not come from R
176
+
177
+ | Python | written as | read back in Python as | note |
178
+ |---|---|---|---|
179
+ | `bool` | logical | `bool` | |
180
+ | `int8`, `int16`, `uint8`, `uint16`, `int32` | integer | `int32` | type widens; INT32_MIN refused |
181
+ | `uint32`, `int64`, `uint64` | `int64="auto"`: integer when every value fits int32 (and none is INT32_MIN), else integer64; `"integer64"`: always integer64; `"double"`: double (refused if a value is past 2^53) | `int32` or `int64` | pandas makes every integer column int64, so `"auto"` keeps ordinary data readable in R without bit64. uint64 above 2^63 - 1 refused |
182
+ | `float16`, `float32`, `float64` | double | `double` | float32 values widen exactly |
183
+ | `decimal128/256` | refused | | cast to double or string first |
184
+ | `string`, `large_string`, `string_view` | character | `string` | pandas 3 `str` arrives as `large_string` (checked) |
185
+ | `binary`, `large_binary`, `fixed_size_binary` | refused (fstx 1.0 has no binary type; phys 5 is reserved) | | except `binary` that fstx itself returned with `invalid_utf8="binary"` |
186
+ | `dictionary<*, string>` | factor | `dictionary<int32, string>` | |
187
+ | `date32` | Date (double) | `date32` | |
188
+ | `date64` | Date (double, fractional when not midnight) | `date32` | |
189
+ | `timestamp[s/ms/us/ns, tz]` | POSIXct (double seconds) | `timestamp[us, tz]` | ns: precision past double's (about 0.2 us today) is lost; unit becomes us; a fixed offset `"+05:30"` is stored as tzone `"<+0530>-05:30"` (section 3.4) |
190
+ | `time32`, `time64` | hms (double seconds, class `c("hms", "difftime")`, units `secs`) | `double` + meta | R prints it as hms with the hms package, as difftime without |
191
+ | `duration[unit]` | difftime, units `secs` | `double` + meta | |
192
+ | `null` (all-null column) | logical, all NA | `bool` | as R's default NA |
193
+ | `list`, `large_list`, `struct`, `map`, `union`, extension types | refused | | R refuses list columns too (checked) |
194
+ | pandas `object` | whatever pyarrow infers; mixed types refused by pyarrow | | |
195
+ | pandas `Period`, `Interval`, sparse | refused | | |
196
+
197
+ ### 3.7 Tables, row names, names and attributes
198
+
199
+ | R | file | Python | Python write back | RT / lost |
200
+ |---|---|---|---|---|
201
+ | data.frame / data.table / tibble class | table blob (FXA1) `class` | schema meta `fstx.table_attrs` (the blob, base64); class shown in `FileMeta` | blob from meta; no meta -> `class = "data.frame"` | yes [basic, tibble] |
202
+ | automatic row names | not stored | none | none | yes |
203
+ | character row names | table blob `row.names` | kept in the blob; a read of some rows (`rows=`, `filters=`) rewrites the blob so the names follow the rows read; `fstx.to_pandas` makes them the index | from the blob when the row count still matches, else dropped; from pandas: a string index becomes row names, a RangeIndex 0..n-1 none | yes [rownames_char]. Risk: moving rows of a pyarrow.Table after the read (`take`, `sort_by`, `filter`) keeps its metadata, so row names would pair with the wrong rows; select rows in `read_fstx`, or use pandas when rows move |
204
+ | integer row names that are not automatic (`x[c(4, 2), ]`) | table blob, integer | as above; integer index | as above | yes [rownames_int] |
205
+ | data.table key (`sorted`) | table blob | kept | kept only if the key columns are still sorted (checked by the writer) and rows were not dropped | yes when still sorted [datatable] |
206
+ | data.table index (`index`) | table blob (order vectors) | kept | **always dropped**: the writer cannot tell whether rows moved; data.table rebuilds indices when needed | **no** [datatable] |
207
+ | other table attributes (plain vectors) | FXA1 | decoded into `FileMeta`, blob kept | blob kept | yes [attrs_fxa1] |
208
+ | column attributes (labels, units, comment, named vectors) | column FXA1 blob | field meta `fstx.attrs` (base64) + decoded in `ColumnMeta` | blob kept when the column type is unchanged | yes [attrs_fxa1] |
209
+ | list-valued attributes (any attribute FXA1 cannot hold) | R serialization blob | opaque bytes (base64) in meta, never decoded; `attributes=False` drops them | written back unchanged (table blob: only if the row count is unchanged, since it may hold row names) | yes when unchanged [attrs_serialized] |
210
+ | duplicate names, `""` | as written | kept (pyarrow allows both) | kept | yes [names] |
211
+ | name `NA` | R writes it as `"NA"` | `"NA"` | `"NA"` | already not identical inside R (checked: NA name reads back as "NA") |
212
+ | 0 x 0, 0 rows, 0 columns with rows | as written | 0 columns with rows: `RecordBatch.from_struct_array` of an empty struct gives a table of n rows (checked) | row count kept | yes [empty_0x0, zero_rows, zero_cols_5rows] |
213
+ | raw, complex, list, matrix columns | **refused by R** (checked) | - | - | no file holds them |
214
+
215
+ ## 4. Arrow metadata
216
+
217
+ One contract for the reader and the writer (keys and helpers: `fstx/_meta.py`). Every value is ASCII text, so
218
+ other libraries can carry a table read by fstx: polars reads Arrow metadata as UTF-8 and refuses anything else
219
+ (`pl.from_arrow(read_fstx(...))` works on every file, checked on R-serialized and non-ASCII blobs).
220
+
221
+ Field metadata:
222
+
223
+ - `fstx.r`: JSON `{"phys", "logical", "class"?, "tzone"?}`: how R holds the column. `phys` is integer / double /
224
+ logical / character; `logical` is none / factor / Date / POSIXct; `class` is R's class vector (absent when
225
+ there is none, or when an R-serialization blob hides it); `tzone` is there only for a POSIXct column stored
226
+ natively with a tzone attribute (`""` = stored empty, key absent = no attribute). Examples:
227
+ `{"phys":"integer","logical":"none"}`, `{"phys":"double","logical":"Date","class":["Date"]}`,
228
+ `{"phys":"double","logical":"POSIXct","class":["POSIXct","POSIXt"],"tzone":""}`,
229
+ `{"phys":"double","logical":"none","class":["integer64"]}`.
230
+ The reader puts it on every column. The writer accepts a column without it and writes it as the plain data it
231
+ is (section 3.6).
232
+ - `fstx.attrs`: the column's attribute blob (FXA1 or R serialization, spec 9.4), base64.
233
+
234
+ Schema metadata:
235
+
236
+ - `fstx.table_attrs`: the table's attribute blob, base64.
237
+ - `fstx.nrow`: the file's row count, decimal text. Only on a read of the whole file whose table blob is R
238
+ serialization: nobody here can look into such a blob, so the writer keeps it only for a table that still has
239
+ this many rows (or when the bytes `row.names` do not occur in it) and otherwise drops it with a warning.
240
+
241
+ The writer also takes both blobs as raw bytes: a raw blob is never valid base64 (FXA1 has the byte 0x01 at offset
242
+ 3, R serialization a line feed at offset 1), so the two cannot be confused.
243
+
244
+ Row names live in the table blob and nowhere else. A read of every row in file order hands the blob out as
245
+ stored. Any other read (`rows=`, `filters=`, a slice) rewrites an FXA1 blob: `row.names` become those of the rows
246
+ read, in the order read; repeats are made unique as R's `x[rows, ]` does (`r2`, `r2.1`, ...); automatic row names
247
+ get the new count. So a partial read followed by a write gives R the row names of exactly those rows (checked
248
+ in R). An R-serialization blob cannot be rewritten: it is handed out without `fstx.nrow`.
249
+
250
+ The writer uses `fstx.r` only when it agrees with the Arrow type (a `date32` field with `phys: integer` writes an
251
+ int Date; a `string` field that still carries Date meta ignores it and warns). Blobs: column blobs are kept when the
252
+ Arrow type is the one the reader made; table blobs are re-encoded (FXA1) with row names, key and index dropped as
253
+ section 3.7 says, and kept byte for byte when nothing was dropped.
254
+
255
+ pyarrow keeps both kinds of metadata through `select`, `slice`, `filter`, `take`, `sort_by` and `concat_tables`
256
+ (checked); a column replaced with `set_column` loses its field metadata while the schema metadata stays (checked).
257
+
258
+ pandas: `from_pandas` builds its own metadata, so `fstx.to_pandas` stores ours under one key, and the writer
259
+ looks there:
260
+
261
+ df.attrs["fstx"] = {"table_attrs": base64 text or None, "nrow": int or None,
262
+ "columns": [{"name": str, "r": dict or None, "attrs": base64 text or None}, ...]}
263
+
264
+ It is plain JSON data. Stored row names become the index, and on a write the index decides the row names
265
+ (distinct strings, or distinct whole numbers other than 0..n-1; a RangeIndex 0..n-1 means none). Column entries
266
+ are matched by position and name, else by a name that occurs once, so dropping or reordering columns keeps
267
+ them. `write_fstx(fstx.to_pandas(read_fstx(p)), q)` loses nothing of how R held the table; what pandas itself
268
+ cannot hold is in section 8.
269
+
270
+ polars has no metadata and no index: `fstx.to_polars` (or `pl.from_arrow`) gives the values, and a write from
271
+ the polars DataFrame stores plain data (section 8). Write from the pyarrow.Table to keep R's classes,
272
+ attributes and row names.
273
+
274
+ ## 5. NA semantics, per type
275
+
276
+ | type | R missing value | file | Arrow |
277
+ |---|---|---|---|
278
+ | logical, integer, factor codes | NA_integer_ = 0x80000000 | missing-value block | null; a non-null 0x80000000 in Python is refused on write |
279
+ | double | NA_real_ = 0x7FF00000000007A2 (also its quiet form 0x7FF80000000007A2) | block marks the exact pattern; quiet form stored as a value | null for any NaN whose low word is 1954; other NaN are values |
280
+ | double NaN | not NA (`is.na` TRUE, `is.nan` TRUE) | value | `nan` |
281
+ | Date / POSIXct | NA_real_; Inf / NaN are values | as double | null (and Inf / NaN become null too, section 3.4) |
282
+ | character | NA_character_ | block; `""` is a value | null; `""` stays `""` |
283
+ | integer64 | INT64_MIN bits (= the double -0.0) | a value (the file sees -0.0) | null only for INT64_MIN |
284
+
285
+ ## 6. Implementation notes for the binding
286
+
287
+ - Read: `fstx_arrow_stream_open()` gives an `ArrowArrayStream`; Python post-processes per column only where the
288
+ stream cannot know R's meaning: integer64 (reinterpret the float64 values buffer as int64, rebuild validity from
289
+ INT64_MIN), factor in a blob (int32 codes + FXA1 levels -> dictionary), dictionary strings -> plain strings,
290
+ invalid UTF-8 check, metadata. These are zero-copy or one pass over a buffer.
291
+ - Two small additions to the shared stream code, both off by default so R is unchanged: (a) a "raw" switch that
292
+ returns Date / POSIXct columns as their stored float64 / int32 (for `datetimes="float"` and for the lossless
293
+ checks), and (b) a switch to skip the NaN-1954 null scan for a column (integer64). Both live in
294
+ `fstx_arrow_args`. Everything else in `src/` is used as it is.
295
+ - Write: `fstx_writer_open()` / `fstx_writer_append()` with `fstx_write_column` built from the Arrow schema and
296
+ `fstx_column_data` pointing at the Arrow buffers. Strings go through the `get_strings` callback straight from
297
+ the Arrow offsets and data buffers (it runs on worker threads, so it must not touch Python objects). Arrays with
298
+ nulls are copied once into R's layout (NA sentinels), since the engine takes plain value arrays.
299
+ - Strings that repeat (18 Nov 2026): the engine's string dictionary keys on the host's string pointers, since R's
300
+ string cache gives equal strings one pointer. Arrow gives every row its own pointer, so a 20-value column
301
+ written from Python was never dictionary-coded (FSST / plain instead: slower to write and read, other bytes
302
+ than R's). `_text_chunks()` therefore hands a column that repeats its values (n <= 65,536, or at most
303
+ half distinct in its first 65,536 rows, where the engine itself gives up) as int32 codes into one dictionary
304
+ shared by every chunk, coded in slices on the write threads and then unified. `write.cpp` takes such chunks
305
+ and checks the dictionary once (UTF-8, NUL, length) plus every code's range; an error still names the first row
306
+ holding the bad value. File format, metadata and `src/` unchanged.
307
+ - FXA1 encode / decode in Python per spec 9.4 (count / length checks, three levels, UTF-8 checks). The R
308
+ serialization path is never decoded.
309
+ - Appends follow R's rules (`.append_prepare()` in `R/m5.R`): same names, types and classes; factor levels may
310
+ grow at the end; same time zone; no appends to files with stored row names.
311
+
312
+ ## 7. Tests: golden files
313
+
314
+ `python/tests/golden/` (made by `make_golden.R`; `Rscript make_golden.R` regenerates them byte for byte, checked):
315
+
316
+ - 35 small `.fstx` files, one per case in section 3 (464 KB with their sidecars), each with a `<case>.json`
317
+ sidecar: per column the stored phys / logical / levels / tzone / blob kind (and blob bytes), the expected Arrow
318
+ type, null count, every value (doubles also as exact bit patterns), a canonical md5 over all values, and the page
319
+ list (kind, encoding, missing-value mode, codec). Columns over 100 rows list their first 12 values; the md5 covers
320
+ the rest. A Python test needs no R. The encoding of the sidecar is described at the top of `make_golden.R`.
321
+ - `manifest.json`: per case what it covers and the expected R -> Python -> R result through pyarrow, through
322
+ pandas and through polars ("identical ..." or the reason it is not).
323
+ - `format-1.0.json`: the same expectations for the package's own format golden files
324
+ (`tests/testthat/fixtures/golden-1.0`: all 294 mixes of page kind x encoding x missing-value mode x codec,
325
+ appends, compaction, and every reserved number that must be refused, with the message). Python reads those files
326
+ from there.
327
+ - Codecs: none, LZ4, Zstandard 1 and 19 (on every page), profiles fast / balanced / small. pcodec cannot be tested
328
+ as written data: fstx 1.0 never writes codec 4; its refusal is in `format-1.0.json`.
329
+ - `check_roundtrip.R`: after the Python tests write `from_python/<case>.fstx` (read_fstx -> write_fstx),
330
+ `from_python/<case>.pandas.fstx` (through `fstx.to_pandas`) and `from_python/<case>.polars.fstx` (through
331
+ `fstx.to_polars`), it compares each with the original in R with identical() and reports PASS / KNOWN (expected
332
+ difference) / BETTER / FAIL / ERROR, plus bit-level differences identical() does not see. Exit status 1 on
333
+ FAIL or ERROR.
334
+ - `check_native.R`: R reads the files made from data that never came from R, and the partial reads of golden
335
+ files written back (`from_python/native/`), and compares them with the same tables built in R.
336
+
337
+ ## 8. Round trips that will not be identical
338
+
339
+ Through pyarrow, with metadata kept:
340
+
341
+ 1. Sub-microsecond POSIXct seconds (any `Sys.time()` value): rounded to the microsecond. [datetimes_subus]
342
+ 2. Date or POSIXct holding Inf, -Inf or NaN: become NA; fractional Dates are floored. [dates_odd, datetimes_odd]
343
+ 3. Strings that are not valid UTF-8: replaced unless `invalid_utf8="binary"`. [strings_invalid_utf8]
344
+ 4. data.table secondary index: dropped by the writer. [datatable]
345
+ 5. Quiet NA_real_ (0x7FF80000000007A2): comes back as NA_real_; identical() TRUE, bits differ. [basic]
346
+
347
+ With metadata lost (a table rebuilt by compute functions, or pandas without `fstx.to_pandas`): Date as integer
348
+ becomes double; tzone `""` and no tzone both become `"UTC"`; integer64 survives (it is a real int64) but difftime,
349
+ labels, classes, row names and the table class are gone; Python-made factors lose nothing.
350
+
351
+ Through pandas, additionally: R's NaN becomes NA in double columns; integer columns with NA turn double unless
352
+ nullable dtypes are used (`fstx.to_pandas` uses them; plain `Table.to_pandas()` turns int64 with nulls into float64
353
+ and loses precision past 2^53, checked); a factor with an NA level cannot be a Categorical (`fstx.to_pandas`
354
+ returns it as strings, with a warning). [basic, difftime, factor_na_level]
355
+
356
+ Through polars (no metadata, no index): everything listed under "metadata lost" above, and also: a Categorical
357
+ keeps only the levels in use, in order of first appearance, and no order; an empty or all-null Categorical has
358
+ no levels; a factor with an NA level comes back as strings, as through pandas (found by `test_rmatch.py`,
359
+ 18 Nov 2026); an Int64 that is empty, all null, or whose values all fit int32 comes back integer (`int64="auto"`;
360
+ the last found by `test_rmatch.py`, 18 Nov 2026); repeated column names are refused. Plain logical, integer,
361
+ double and character columns, integer64 columns with a value past int32, and Dates stored as double, come back
362
+ identical. Per case: `roundtrip_polars` in `manifest.json`.
363
+
364
+ Fixed UTC offsets (18 Nov 2026): through pyarrow and `fstx.to_pandas` they round-trip (the file holds R's POSIX
365
+ form, section 3.4; in R they show the right clock time with an "unknown timezone" warning). polars knows only
366
+ named zones (`unable to parse time zone: '+05:30'`): `fstx.to_polars` returns such a column in UTC, the same
367
+ instants, with an `FstxWarning`, and written from polars it is a UTC column. [test_rmatch.py, `native_fixed_offset.*`]
368
+
369
+ ## 9. Decisions (Harsh, 17 Nov 2026: "Yes, all four")
370
+
371
+ 1. **int64 from pandas**: `int64="auto"`: int32 when the values fit, else bit64 integer64.
372
+ 2. **Bad UTF-8 by default**: replace with U+FFFD and warn; the binary mode keeps the bytes.
373
+ 3. **Row numbers**: 0-based in Python.
374
+ 4. **Dates and times by default**: Arrow types (date32, timestamp[us]); `datetimes="float"` returns the exact stored values.
375
+
376
+ Later, with the merge of the read, write and wheels branches (Harsh, 17 Nov 2026: "Yes, merge all", as passed on
377
+ by the coordinating session):
378
+
379
+ 5. **Attribute blobs in Arrow metadata**: base64 text (`fstx.attrs`, `fstx.table_attrs`), not raw bytes, so that
380
+ polars and other libraries that read metadata as UTF-8 accept the tables. The writer takes raw bytes as well.