Add FixedPointDecimals package extension for FixedDecimal → Dec128 BSON representation#42
Merged
Merged
Conversation
…epresentation Agent-Logs-Url: https://github.com/ancapdev/LightBSON.jl/sessions/36139d1b-9e70-4c41-8782-69069d79253d Co-authored-by: ancapdev <2189089+ancapdev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add package extension for FixedDecimal types
Add FixedPointDecimals package extension for FixedDecimal → Dec128 BSON representation
Mar 31, 2026
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42 +/- ##
==========================================
+ Coverage 90.08% 90.12% +0.03%
==========================================
Files 13 14 +1
Lines 787 790 +3
==========================================
+ Hits 709 712 +3
Misses 78 78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ancapdev
reviewed
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FixedDecimaltypes from FixedPointDecimals.jl had no BSON representation, requiring manual conversion. This adds a weak dependency extension that mapsFixedDecimal{T,f}to BSONdecimal128viaDec128, using precise decimal arithmetic throughout.Changes
ext/LightBSONFixedPointDecimalsExt.jl— new package extension (loaded only when FixedPointDecimals.jl is present):bson_representation_type(FixedDecimal{T,f}) = Dec128Dec128(x.i, -f)— exact conversion using raw integer coefficient and scalereinterpret(FixedDecimal{T,f}, T(x * Dec128(1, f)))— reconstructs the raw integer via decimal-only arithmetic, avoiding binary float precision lossProject.toml— addsFixedPointDecimalsas a weak dependency with compat"0.5, 0.6", registers the extension, bumps julia compat to"1.9"(minimum for package extensions), and addsFixedPointDecimalsto test extras/targetstest/fixed_decimal_tests.jl— roundtrip tests for multiple scale factors; confirms conversion is bit-exactUsage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/FluxML/MacroTools.jl/tarball/1e0228a030642014fe5cfe68c2c0a818f9e3f522/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaArrays/StaticArraysCore.jl/tarball/6ab403037779dae8c514bad259f32a447262455a/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaArrays/UnsafeArrays.jl/tarball/c63023bd84f46f9df786c90180d4f79dbfdafa2a/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaBinaryWrappers/DecFP_jll.jl/tarball/40e4404a0a267a8e75f5c1ce2cc9b5e2ce1ba268/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaBinaryWrappers/OpenSpecFun_jll.jl/tarball/1346c9208249809840c91b26703912dff463d335/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/e86f4a2805f7f19bec5129bc9150c38208e5dc23/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaData/Parsers.jl/tarball/7d2f8f21da5db6a806faf7b9b292296da42b2810/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaData/StructTypes.jl/tarball/159331b30e94d7b11379037feeb9b690950cace8/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaData/WeakRefStrings.jl/tarball/b1be2855ed9ed8eac54e5caff2afcdb442d52c23/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaDocs/DocStringExtensions.jl/tarball/7442a5dfe1ebb773c29cc2962a8980f47221d76c/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaFolds/InitialValues.jl/tarball/4da0f88e9a39111c2fa3add390ab15f3a44f3ca3/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaFolds/SplittablesBase.jl/tarball/e08a62abc517eb79667d0a29dc08a3b589516bb5/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaFolds2/BangBang.jl/tarball/cceb62468025be98d42a5dc581b163c20896b040/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaFolds2/MicroCollections.jl/tarball/44d32db644e84c75dab479f1bc15ee76a1a3618f/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaFolds2/Transducers.jl/tarball/4aa1fdf6c1da74661f6f5d3edfd96648321dade9/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaFunctional/CompositionsBase.jl/tarball/802bb88cd69dfd1509f6670416bd4434015693ad/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/07a921781cab75691315adc645096ed5e370cb77/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaMath/DecFP.jl/tarball/3b98337b5b709548754973b9d79f4d5f2038c7cf/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaMath/FixedPointDecimals.jl/tarball/41d3a5de0eab320cc04833a373f0fcb3640073d5/usr/bin/julia julia -e using Pkg; Pkg.add("FixedPointDecimals")(http block)https://api.github.com/repos/JuliaMath/InverseFunctions.jl/tarball/a779299d77cd080bf77b97535acecd73e1c5e5cb/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaMath/IrrationalConstants.jl/tarball/b2d91fe939cae05960e760110b328288867b5758/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaMath/SpecialFunctions.jl/tarball/2700b235561b0335d5bef7097a111dc513b8655e/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaObjects/Accessors.jl/tarball/2eeb2c9bef11013efc6f8f97f32ee59b146b09fb/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaObjects/ConstructionBase.jl/tarball/b4b092499347b18a015186eae3042f72267106cb/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaPackaging/JLLWrappers.jl/tarball/0533e564aae234aff59ab625543145446d8b6ec2/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/8b770b60760d4451834fe79dd483e318eee709c4/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaStats/LogExpFunctions.jl/tarball/13ca9e2586b89836fd20cccf56e57e2b9ae7f38f/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaStrings/InlineStrings.jl/tarball/8f3d257792a522b4601c24a577954b0a8cd7334d/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/ancapdev/FNVHash.jl/tarball/d6de2c735a8bffce9bc481942dfa453cc815357e/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/jw3126/ArgCheck.jl/tarball/f9e9a66c9b7be1ad7372bbd9b062d9230c30c5ce/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/jw3126/Setfield.jl/tarball/c5391c6ace3bc430ca630251d02ea9687169ca68/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/quinnj/JSON3.jl/tarball/411eccfe8aba0814ffa0fdf4860913ed09c34975/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/rfourquet/BitIntegers.jl/tarball/091d591a060e43df1dd35faab3ca284925c48e46/usr/bin/julia julia -e using Pkg; Pkg.add("FixedPointDecimals")(http block)https://api.github.com/repos/tkf/Baselet.jl/tarball/aebf55e6d7795e02ca500a689d326ac979aaf89e/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/tkf/DefineSingletons.jl/tarball/0fba8b706d0178b4dc7fd44a96a92382c9065c2c/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(http block)pkg.julialang.org/usr/bin/julia julia --project -e import Pkg; Pkg.instantiate()(dns block)/usr/bin/julia julia -e using Pkg; Pkg.add("FixedPointDecimals")(dns block)If you need me to access, download, or install something from one of these locations, you can either: