     Testing Margins
      Status `/private/var/folders/td/5b_qj7x16jlfbrt5dgq_y34m0000gp/T/jl_tsCoLV/Project.toml`
  [6e4b80f9] BenchmarkTools v1.6.3
  [336ed68f] CSV v0.10.16
⌅ [324d7699] CategoricalArrays v0.10.9
  [60f91f6f] CovarianceMatrices v0.30.4
  [a93c6f00] DataFrames v1.8.1
  [31c24e10] Distributions v0.25.123
  [72341345] FormulaCompiler v1.3.0 `~/.julia/dev/FormulaCompiler`
  [38e38edf] GLM v1.9.3
  [883ce5cb] Margins v2.1.1 `~/.julia/dev/Margins`
⌅ [ff71e718] MixedModels v4.38.1
  [ce6b1742] RDatasets v0.8.1
  [10745b16] Statistics v1.11.1
  [2913bbd2] StatsBase v0.34.10
  [3eaba693] StatsModels v0.7.9
  [bd369af6] Tables v1.12.1
  [ade2ca70] Dates v1.11.0
  [37e2e46d] LinearAlgebra v1.12.0
  [de0858da] Printf v1.11.0
  [9a3f8284] Random v1.11.0
  [8dfed614] Test v1.11.0
      Status `/private/var/folders/td/5b_qj7x16jlfbrt5dgq_y34m0000gp/T/jl_tsCoLV/Manifest.toml`
  [79e6a3ab] Adapt v4.4.0
  [66dad0bd] AliasTables v1.1.3
  [4fba245c] ArrayInterface v7.22.0
  [4c555306] ArrayLayouts v1.12.2
  [69666777] Arrow v2.8.1
  [31f734f8] ArrowTypes v2.3.0
  [093aae92] BSplineKit v0.19.2
  [aae01518] BandedMatrices v1.11.0
  [6e4b80f9] BenchmarkTools v1.6.3
  [c3b6d118] BitIntegers v0.3.7
  [0a1fb500] BlockDiagonals v0.2.0
  [fa961155] CEnum v0.5.0
  [336ed68f] CSV v0.10.16
⌅ [324d7699] CategoricalArrays v0.10.9
  [5ba52731] CodecLz4 v0.4.6
  [944b1d66] CodecZlib v0.7.8
  [6b39b394] CodecZstd v0.8.7
  [861a8166] Combinatorics v1.1.0
  [bbf7d656] CommonSubexpressions v0.3.1
  [f70d9fcc] CommonWorldInvalidations v1.0.0
  [34da2185] Compat v4.18.1
  [f0e56b4a] ConcurrentUtilities v2.5.1
  [60f91f6f] CovarianceMatrices v0.30.4
  [a8cc5b0e] Crayons v4.1.1
  [9a962f9c] DataAPI v1.16.0
  [a93c6f00] DataFrames v1.8.1
  [864edb3b] DataStructures v0.19.3
  [e2d170a0] DataValueInterfaces v1.0.0
  [85a47980] Dictionaries v0.4.6
  [163ba53b] DiffResults v1.1.0
  [b552c78f] DiffRules v1.15.1
  [31c24e10] Distributions v0.25.123
  [ffbed154] DocStringExtensions v0.9.5
  [4e289a0a] EnumX v1.0.6
  [e2ba6199] ExprTools v0.1.10
  [442a2c76] FastGaussQuadrature v1.1.0
  [5789e2e9] FileIO v1.18.0
  [48062228] FilePathsBase v0.9.24
  [1a297f60] FillArrays v1.16.0
  [72341345] FormulaCompiler v1.3.0 `~/.julia/dev/FormulaCompiler`
  [f6369f11] ForwardDiff v1.3.2
  [38e38edf] GLM v1.9.3
  [34004b35] HypergeometricFunctions v0.3.28
  [615f187c] IfElse v0.1.1
  [313cdc1a] Indexing v1.1.1
  [842dd82b] InlineStrings v1.4.5
  [41ab1584] InvertedIndices v1.3.1
  [92d709cd] IrrationalConstants v0.2.6
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.7.1
⌃ [682c06a0] JSON v0.21.4
  [0f8b85d8] JSON3 v1.14.3
  [b964fa9f] LaTeXStrings v1.4.0
  [2ab3a3ac] LogExpFunctions v0.3.29
  [1914dd2f] MacroTools v0.5.16
  [883ce5cb] Margins v2.1.1 `~/.julia/dev/Margins`
  [e1d29d7a] Missings v1.2.0
⌅ [ff71e718] MixedModels v4.38.1
  [7e9fb7ac] MixedModelsDatasets v0.1.2
  [78c3b35d] Mocking v0.8.1
  [76087f3c] NLopt v1.2.1
  [77ba4419] NaNMath v1.1.3
  [b946abbf] NaNStatistics v0.6.56
  [bac558e1] OrderedCollections v1.8.1
  [90014a1f] PDMats v0.11.37
  [69de0a69] Parsers v2.8.3
  [2dfb63ee] PooledArrays v1.4.3
  [aea7be01] PrecompileTools v1.3.3
  [21216c6a] Preferences v1.5.1
  [08abe8d2] PrettyTables v3.2.3
  [92933f4c] ProgressMeter v1.11.0
  [43287f4e] PtrArrays v1.4.0
  [1fd47b50] QuadGK v2.11.2
  [df47a6cb] RData v1.1.0
  [ce6b1742] RDatasets v0.8.1
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.1
  [79098fc4] Rmath v0.9.0
  [431bcebd] SciMLPublic v1.0.1
  [6c6a2e73] Scratch v1.3.0
  [91c51154] SentinelArrays v1.4.9
  [1277b4bf] ShiftedArrays v2.0.0
  [a2af1166] SortingAlgorithms v1.2.2
  [276daf66] SpecialFunctions v2.7.1
  [03a91e81] SplitApplyCombine v1.2.3
  [5064a6a7] StandardizedPredictors v1.0.1
  [aedffcd0] Static v1.3.1
  [0d7ed370] StaticArrayInterface v1.9.0
  [90137ffa] StaticArrays v1.9.17
  [1e83bf80] StaticArraysCore v1.4.4
  [10745b16] Statistics v1.11.1
  [82ae8749] StatsAPI v1.8.0
  [2913bbd2] StatsBase v0.34.10
  [4c63d2b9] StatsFuns v1.5.2
  [3eaba693] StatsModels v0.7.9
  [892a3eda] StringManipulation v0.4.2
  [354b36f9] StringViews v1.3.7
  [856f2bd8] StructTypes v1.11.0
  [dc5dba14] TZJData v1.5.0+2025b
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.12.1
  [f269a46b] TimeZones v1.22.2
  [3bb67fe8] TranscodingStreams v0.11.3
  [9d95f2ec] TypedTables v1.4.6
  [ea10d353] WeakRefStrings v1.4.2
  [76eceee3] WorkerUtilities v1.6.1
  [5ced341a] Lz4_jll v1.10.1+0
  [079eb43e] NLopt_jll v2.10.0+0
  [efe28fd5] OpenSpecFun_jll v0.5.6+0
  [f50d1b31] Rmath_jll v0.5.1+0
  [3161d3a3] Zstd_jll v1.5.7+1
  [0dad84c5] ArgTools v1.1.2
  [56f22d72] Artifacts v1.11.0
  [2a0f44e3] Base64 v1.11.0
  [ade2ca70] Dates v1.11.0
  [8ba89e20] Distributed v1.11.0
  [f43a241f] Downloads v1.7.0
  [7b1f6079] FileWatching v1.11.0
  [9fa8497b] Future v1.11.0
  [b77e0a4c] InteractiveUtils v1.11.0
  [ac6e5ff7] JuliaSyntaxHighlighting v1.12.0
  [4af54fe1] LazyArtifacts v1.11.0
  [b27032c2] LibCURL v0.6.4
  [76f85450] LibGit2 v1.11.0
  [8f399da3] Libdl v1.11.0
  [37e2e46d] LinearAlgebra v1.12.0
  [56ddb016] Logging v1.11.0
  [d6f4376e] Markdown v1.11.0
  [a63ad114] Mmap v1.11.0
  [ca575930] NetworkOptions v1.3.0
  [44cfe95a] Pkg v1.12.1
  [de0858da] Printf v1.11.0
  [9abbd945] Profile v1.11.0
  [3fa0cd96] REPL v1.11.0
  [9a3f8284] Random v1.11.0
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization v1.11.0
  [6462fe0b] Sockets v1.11.0
  [2f01184e] SparseArrays v1.12.0
  [f489334b] StyledStrings v1.11.0
  [4607b0f0] SuiteSparse
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [8dfed614] Test v1.11.0
  [cf7118a7] UUIDs v1.11.0
  [4ec0a83e] Unicode v1.11.0
  [e66e0078] CompilerSupportLibraries_jll v1.3.0+1
  [deac9b47] LibCURL_jll v8.15.0+0
  [e37daf67] LibGit2_jll v1.9.0+0
  [29816b5a] LibSSH2_jll v1.11.3+1
  [14a3606d] MozillaCACerts_jll v2025.11.4
  [4536629a] OpenBLAS_jll v0.3.29+0
  [05823500] OpenLibm_jll v0.8.7+0
  [458c3c95] OpenSSL_jll v3.5.4+0
  [bea87d4a] SuiteSparse_jll v7.8.3+2
  [83775a58] Zlib_jll v1.3.1+2
  [8e850b90] libblastrampoline_jll v5.15.0+0
  [8e850ede] nghttp2_jll v1.64.0+1
  [3f19e933] p7zip_jll v17.7.0+0
        Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading.
Precompiling for configuration --code-coverage=none --color=auto --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none
   3768.3 ms  ✓ Margins
  1 dependency successfully precompiled in 4 seconds. 181 already precompiled.
     Testing Running tests...
[ Info: Skipping contrasts for variable z: specified as mixture in reference grid (use discrete levels if contrasts desired)

Minimizing 4    Time: 0:00:00 (25.00 ms/it)[K
   objective: 1794.5937061331388[K
[A

[K[A
Minimizing 14    Time: 0:00:00 ( 8.38 ms/it)[K
┌ Warning: `wts` keyword argument is deprecated, use `weights` instead
│   caller = glm(::Matrix{Float64}, ::Vector{Float64}, ::Binomial{Float64}, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Any, Nothing, @NamedTuple{wts::Vector{Float64}, dofit::Bool, offset::Vector{Float64}}}) at glmfit.jl:618
└ @ Core ~/.julia/packages/GLM/brCVV/src/glmfit.jl:618
┌ Warning: `wts` keyword argument is deprecated, use `weights` instead
│   caller = glm(::Matrix{Float64}, ::Vector{Float64}, ::Bernoulli{Float64}, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Any, Nothing, @NamedTuple{wts::Vector{Float64}, dofit::Bool, offset::Vector{Float64}}}) at glmfit.jl:618
└ @ Core ~/.julia/packages/GLM/brCVV/src/glmfit.jl:618
[ Info: Skipping contrasts for variable education: specified as mixture in reference grid (use discrete levels if contrasts desired)
┌ Warning: Empty dataset provided to hierarchical_grid(). Representative values may be undefined (NaN/missing).
└ @ Margins ~/.julia/dev/Margins/src/profile/reference_grids.jl:904
┌ Warning: Categorical combination Dict(:education => "Graduate", :country => "USA", :region => "South", :city => "CityB") matches no observations in data
└ @ Margins ~/.julia/dev/Margins/src/profile/reference_grids.jl:1048
┌ Warning: Categorical combination Dict(:education => "HS", :country => "USA", :region => "South", :city => "CityA") matches no observations in data
└ @ Margins ~/.julia/dev/Margins/src/profile/reference_grids.jl:1048
┌ Warning: Categorical combination Dict(:education => "HS", :country => "USA", :region => "East", :city => "CityB") matches no observations in data
└ @ Margins ~/.julia/dev/Margins/src/profile/reference_grids.jl:1048
┌ Warning: 16 out of 24 categorical combinations (66.7%) match no data. Consider reviewing specification.
└ @ Margins ~/.julia/dev/Margins/src/profile/reference_grids.jl:1057
[ Info: Medium grid estimated: 15000 combinations.
[ Info: Skipping contrasts for variable bool_implicit: specified as mixture in reference grid (use discrete levels if contrasts desired)
[ Info: Skipping contrasts for variable other_bool: specified as mixture in reference grid (use discrete levels if contrasts desired)
[ Info: Skipping contrasts for variable bool_var: specified as mixture in reference grid (use discrete levels if contrasts desired)
┌ Warning: Profile margins scaling ratio 23.1× exceeds 6× threshold — likely CI timing noise
│   largest = 0.001118292
│   mid = 4.85e-5
└ @ Main ~/.julia/dev/Margins/test/performance/test_performance.jl:92
┌ Info: Two-way interaction (Control level)
│   analytical_se = 0.01919193875781165
│   computed_se = 0.01919193875781165
└   relative_error = 0.0
┌ Info: Two-way interaction (Treatment level)
│   analytical_se = 0.017657961696003824
│   computed_se = 0.017657961696003824
└   relative_error = 0.0
┌ Info: GLM interaction (Control level)
│   analytical_se = 0.029420807340945886
│   computed_se = 0.029420807340945886
└   relative_error = 0.0
┌ Info: Three-way interaction (Control level)
│   analytical_se = 0.035727396914119885
│   computed_se = 0.035727396914119885
└   relative_error = 0.0
┌ Info: Contributing coefficients
│   contributing_terms =
│    4-element Vector{Tuple{String, Float64}}:
│     ("x", 1.0)
│     ("x & y", 2.0)
│     ("x & group: Treatment", 0.0)
└     ("x & y & group: Treatment", 0.0)
┌ Info: Three-way interaction (Treatment level)
│   analytical_se = 0.04195067543742631
│   computed_se = 0.04195067543742631
└   relative_error = 0.0
┌ Info: Contributing coefficients
│   contributing_terms =
│    4-element Vector{Tuple{String, Float64}}:
│     ("x", 1.0)
│     ("x & y", 2.0)
│     ("x & group: Treatment", 1.0)
└     ("x & y & group: Treatment", 2.0)
┌ Info: Three-way interaction (y=-1.0, Treatment)
│   analytical_se = 0.023077964192648816
│   computed_se = 0.023077964192648816
└   relative_error = 0.0
┌ Info: Mixed model (random intercept)
│   analytical_se = 0.015003630415821841
│   computed_se = 0.015003630415821851
└   relative_error = 6.937214905590377e-16
┌ Info: Random slope (fixed effects approach)
│   analytical_se = 0.03418879930246711
│   computed_se = 0.03418879930246701
└   relative_error = 3.044371568529978e-15
┌ Info: Mixed interaction (Control level)
│   analytical_se = 0.021655807518806656
│   computed_se = 0.021655807518806656
└   relative_error = 0.0
┌ Info: Mixed interaction (Treatment level)
│   analytical_se = 0.02416288220619948
│   computed_se = 0.02416288220619948
└   relative_error = 0.0
┌ Info: LHS log transformation
│   analytical_se = 0.008268055141649702
│   computed_se = 0.008268055141649707
└   relative_error = 6.294310256489228e-16
┌ Info: RHS log function backend consistency
│   ad_se = 0.024384928204518364
│   fd_se = 0.024384928235856928
└   relative_difference = 1.2851612039081311e-9
┌ Info: Exponential function backend consistency
│   ad_se = 0.01037057249393378
└   fd_se = 0.010370572493949348
┌ Info: Trigonometric function backend consistency
│   ad_se = 0.022727216738993243
└   fd_se = 0.022727216739050007
┌ Info: Power terms backend consistency
│   ad_se = 0.017902593288661735
└   fd_se = 0.01790259328868164
┌ Info: Specialized SE validation coverage
│   compatible_formulas = 11
└   specialized_formulas = 8
┌ Info: Validation methods
│   interactions = "Hand-coded analytical"
│   mixed_models = "Fixed effects vcov"
└   functions = "Backend consistency"
[ Info: Elasticity SE validation framework loaded successfully
[ Info: Quick Bootstrap Validation Check (n_bootstrap=30)
[ Info: Quick validation success rate: 50.0%
Test Summary:      | Pass  Total     Time
Core Functionality |  290    290  1m43.9s
Test Summary:     | Pass  Total     Time
Advanced Features |  778    778  1m35.3s

=== Row Scaling (ad) ===
  n=100: 0.0 total, 0.0 per row
  n=1000: 0.0 total, 0.0 per row
  n=5000: 0.0 total, 0.0 per row
  n=10000: 0.0 total, 0.0 per row

=== Variable Scaling (ad) ===
  nvars=1: 0.0 total, 0.0 per var
  nvars=2: 0.0 total, 0.0 per var
  nvars=4: 0.0 total, 0.0 per var

=== Measure Selection (ad) ===
  effect: 0.0
  elasticity: 0.0
  semielasticity_dyex: 0.0
  semielasticity_eydx: 0.0

=== Fixed Overhead (ad) ===
  Total allocations: 0.0

=== Row Scaling (fd) ===
  n=100: 0.0 total, 0.0 per row
  n=1000: 0.0 total, 0.0 per row
  n=5000: 0.0 total, 0.0 per row
  n=10000: 0.0 total, 0.0 per row

=== Variable Scaling (fd) ===
  nvars=1: 0.0 total, 0.0 per var
  nvars=2: 0.0 total, 0.0 per var
  nvars=4: 0.0 total, 0.0 per var

=== Measure Selection (fd) ===
  effect: 0.0
  elasticity: 0.0
  semielasticity_dyex: 0.0
  semielasticity_eydx: 0.0

=== Fixed Overhead (fd) ===
  Total allocations: 0.0
  1.221 μs (12 allocations: 800 bytes)
  1.221 μs (12 allocations: 800 bytes)
  1.233 μs (12 allocations: 800 bytes)
  19.893 ns (0 allocations: 0 bytes)

Multi-level categorical batch:
  Time (median): 9.791666666666666 μs
  Allocations:   0
  Memory:        0 bytes

Weighted computation:
  Time (median): 9.930666666666665 μs
  Allocations:   0
  Memory:        0 bytes

Boolean categorical batch:
  Time (median): 2.6689444444444446 μs
  Allocations:   0
  Memory:        0 bytes

Performance Results:
  Time (median): 10.666 μs
  Time (min):    9.333 μs
  Allocations:   0
  Memory:        0 bytes

=== Continuous Derivatives ===
1. Warmup call (may allocate for compilation):
  134.641 ns (0 allocations: 0 bytes)

2. Steady-state call (should be 0 bytes):
   Allocations: 0

3. Loop over rows (should be 0 bytes):
   Allocations: 0

=== Continuous Derivatives (Response Scale) ===
1. Warmup call:
  86.210 ns (0 allocations: 0 bytes)

2. Steady-state call (should be 0 bytes):
   Allocations: 0

=== Categorical Contrasts ===
1. Warmup call:
  61.842 ns (0 allocations: 0 bytes)

2. Steady-state call (should be 0 bytes):
   Allocations: 0

3. Binary variable contrast (should be 0 bytes):
   Allocations: 0

4. Loop over multiple contrasts (should be 0 bytes):
   Allocations: 0

=== Categorical Contrast Gradients ===
1. Linear scale gradient (warmup):
  56.742 ns (0 allocations: 0 bytes)

2. Linear scale gradient (should be 0 bytes):
   Allocations: 0

3. Response scale gradient with link (warmup):
  40.321 ns (0 allocations: 0 bytes)

4. Response scale gradient with link (should be 0 bytes):
   Allocations: 0

=== Interaction Terms ===
1. Continuous ME with interaction (warmup):
  59.487 ns (0 allocations: 0 bytes)

2. Continuous ME with interaction (should be 0 bytes):
   Allocations: 0

3. Categorical contrast with interaction (should be 0 bytes):
   Allocations: 0

=== Delta Method SE ===
1. Delta method SE (warmup):
  79.240 ns (0 allocations: 0 bytes)

2. Delta method SE (should be 0 bytes):
   Allocations: 0

=== Evaluator Reuse ===
1. Multiple rows with same evaluator (should be 0 bytes):
   Allocations: 0 (50 rows × 2 contrasts = 100 calls)

=== Warm-up Behavior Analysis ===
1. First call on fresh evaluator:
   Allocations: 0

2. Second call (steady state):
   Allocations: 0

3. 10th call (fully warmed up):
   Allocations: 0

Conclusion: Warm-up phase complete, steady-state achieves 0 allocations
Test Summary:               | Pass  Total     Time
Performance and Allocations |  125    125  1m57.2s
Test Summary:           | Pass  Total     Time
Statistical Correctness |  778    778  2m49.6s
Test Summary:            | Pass  Total     Time
Computational Primitives |  140    140  1m30.6s
Test Summary:    | Pass  Total   Time
Validation Tests |  202    202  33.8s
     Testing Margins tests passed 
