Skip to content

fix: fix "Undefined function g" error by copying RM fields in Assertion.copy()#1658

Merged
hsluoyz merged 3 commits intomasterfrom
copilot/fix-undefined-function-g-again
Jan 6, 2026
Merged

fix: fix "Undefined function g" error by copying RM fields in Assertion.copy()#1658
hsluoyz merged 3 commits intomasterfrom
copilot/fix-undefined-function-g-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

When LoadPolicy() is called, the model is copied but role manager references (RM, CondRM) are not preserved, causing the g() function to not be registered during subsequent Enforce() calls.

Changes

  • model/assertion.go: Copy RM, CondRM, and ParamsTokens fields in Assertion.copy()

Reproduction

m, _ := model.NewModelFromString(`
[role_definition]
g = _, _
[matchers]
m = g(r.sub, p.sub) && r.obj == p.obj
`)

e, _ := casbin.NewEnforcer(m, adapter)
e.AddGroupingPolicy("alice", "admin")
e.LoadPolicy()  // Creates model copy without RM references
e.Enforce("alice", "data", "read")  // Error: Undefined function g

The fix ensures role managers persist through model copies, maintaining the g() function availability.

Original prompt

This section details on the original issue you should resolve

<issue_title>Undefined function g</issue_title>
<issue_description>If I created a new role via enforcer's api, without LoadPolicy() by hand, later when access api, will get error:

Undefined function g

I must call LoadPolicy() by hand, to solve the issue.

So, if I update casbin policy via enforcer api, when do I have to call LoadPolicy() by hand ?

Question on SO: https://stackoverflow.com/questions/79860410/casbin-undefined-function-g
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…copy()

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix undefined function g error in access API Fix "Undefined function g" error by copying RM fields in Assertion.copy() Jan 6, 2026
Copilot AI requested a review from hsluoyz January 6, 2026 08:07
@hsluoyz hsluoyz marked this pull request as ready for review January 6, 2026 08:07
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Benchmark Comparison

Comparing base branch (1aba8b9)
vs PR branch (a748589)

goos: linux
goarch: amd64
pkg: github.com/casbin/casbin/v3
cpu: AMD EPYC 7763 64-Core Processor                
                                                 │ base-bench.txt │             pr-bench.txt             │
                                                 │     sec/op     │    sec/op     vs base                │
CachedRaw-4                                          17.52n ± ∞ ¹   17.67n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedBasicModel-4                                   175.2n ± ∞ ¹   172.8n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModel-4                                    174.9n ± ∞ ¹   171.2n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelSmall-4                               182.4n ± ∞ ¹   180.3n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMedium-4                              186.3n ± ∞ ¹   185.4n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelLarge-4                               161.8n ± ∞ ¹   158.2n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithResourceRoles-4                   178.5n ± ∞ ¹   171.6n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDomains-4                         183.9n ± ∞ ¹   180.9n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedABACModel-4                                    2.806µ ± ∞ ¹   2.852µ ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedKeyMatchModel-4                                189.9n ± ∞ ¹   186.3n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDeny-4                            174.9n ± ∞ ¹   171.2n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedPriorityModel-4                                175.9n ± ∞ ¹   177.7n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedWithEnforceContext-4                           301.0n ± ∞ ¹   305.5n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMediumParallel-4                      172.4n ± ∞ ¹   173.3n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicySmall-4                                     489.6n ± ∞ ¹   507.3n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyMedium-4                                    539.5n ± ∞ ¹   551.2n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyLarge-4                                     534.2n ± ∞ ¹   544.9n ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicySmall-4                                     546.1n ± ∞ ¹   532.1n ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyMedium-4                                    602.3n ± ∞ ¹   621.0n ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyLarge-4                                     1.308µ ± ∞ ¹   1.274µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicySmall-4                                  539.6n ± ∞ ¹   540.5n ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyMedium-4                                 544.3n ± ∞ ¹   587.0n ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyLarge-4                                  646.0n ± ∞ ¹   669.3n ± ∞ ¹       ~ (p=1.000 n=1) ²
Raw-4                                                17.81n ± ∞ ¹   17.64n ± ∞ ¹       ~ (p=1.000 n=1) ²
BasicModel-4                                         3.547µ ± ∞ ¹   3.625µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModel-4                                          5.292µ ± ∞ ¹   5.522µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/small-4                               47.67µ ± ∞ ¹   51.20µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/medium-4                              491.8µ ± ∞ ¹   501.6µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/large-4                               5.258m ± ∞ ¹   5.352m ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSmall-4                                     57.43µ ± ∞ ¹   61.18µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelMedium-4                                    569.9µ ± ∞ ¹   563.4µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelLarge-4                                     5.886m ± ∞ ¹   5.972m ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithResourceRoles-4                         5.245µ ± ∞ ¹   5.390µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomains-4                               5.054µ ± ∞ ¹   5.154µ ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACModel-4                                          2.770µ ± ∞ ¹   2.850µ ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACRuleModel-4                                      4.143m ± ∞ ¹   4.131m ± ∞ ¹       ~ (p=1.000 n=1) ²
KeyMatchModel-4                                      6.041µ ± ∞ ¹   6.267µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDeny-4                                  6.786µ ± ∞ ¹   6.926µ ± ∞ ¹       ~ (p=1.000 n=1) ²
PriorityModel-4                                      4.122µ ± ∞ ¹   4.278µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomainPatternLarge-4                    13.29µ ± ∞ ¹   13.65µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerSmall-4                                   69.83µ ± ∞ ¹   71.30µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerMedium-4                                  729.4µ ± ∞ ¹   716.6µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerLarge-4                                   8.030m ± ∞ ¹   7.712m ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternLarge-4                     328.7m ± ∞ ¹   334.9m ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithDomainPatternLarge-4               11.68m ± ∞ ¹   11.76m ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternAndDomainPatternLarge-4     335.1m ± ∞ ¹   341.0m ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternLarge-4                            1.115µ ± ∞ ¹   1.112µ ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithDomainPatternLarge-4                      479.5n ± ∞ ¹   478.6n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternAndDomainPatternLarge-4            1.127µ ± ∞ ¹   1.115µ ± ∞ ¹       ~ (p=1.000 n=1) ²
ConcurrentHasLinkWithMatching-4                      1.965µ ± ∞ ¹   2.039µ ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                              5.372µ         5.426µ        +1.01%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

                                                 │ base-bench.txt │             pr-bench.txt              │
                                                 │      B/op      │     B/op       vs base                │
CachedRaw-4                                           0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedBasicModel-4                                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModel-4                                     104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelSmall-4                                104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMedium-4                               104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelLarge-4                                96.00 ± ∞ ¹     96.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithResourceRoles-4                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDomains-4                          120.0 ± ∞ ¹     120.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedABACModel-4                                   1.505Ki ± ∞ ¹   1.505Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedKeyMatchModel-4                                 152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDeny-4                             104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedPriorityModel-4                                 104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedWithEnforceContext-4                            240.0 ± ∞ ¹     240.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMediumParallel-4                       105.0 ± ∞ ¹     105.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicySmall-4                                      150.0 ± ∞ ¹     150.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyMedium-4                                     157.0 ± ∞ ¹     157.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyLarge-4                                      165.0 ± ∞ ¹     165.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicySmall-4                                      152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyMedium-4                                     168.0 ± ∞ ¹     169.0 ± ∞ ¹       ~ (p=1.000 n=1) ³
AddPolicyLarge-4                                      464.0 ± ∞ ¹     452.0 ± ∞ ¹       ~ (p=1.000 n=1) ³
RemovePolicySmall-4                                   166.0 ± ∞ ¹     166.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyMedium-4                                  174.0 ± ∞ ¹     174.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyLarge-4                                   181.0 ± ∞ ¹     181.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Raw-4                                                 0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
BasicModel-4                                        1.470Ki ± ∞ ¹   1.471Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModel-4                                         2.011Ki ± ∞ ¹   2.017Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/small-4                              19.79Ki ± ∞ ¹   19.76Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/medium-4                             187.2Ki ± ∞ ¹   187.1Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/large-4                              1.812Mi ± ∞ ¹   1.810Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSmall-4                                    19.89Ki ± ∞ ¹   19.78Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelMedium-4                                   190.0Ki ± ∞ ¹   189.7Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelLarge-4                                    1.843Mi ± ∞ ¹   1.843Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithResourceRoles-4                        2.672Ki ± ∞ ¹   2.669Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithDomains-4                              1.786Ki ± ∞ ¹   1.784Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
ABACModel-4                                         1.500Ki ± ∞ ¹   1.497Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
ABACRuleModel-4                                     1.266Mi ± ∞ ¹   1.262Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
KeyMatchModel-4                                     2.995Ki ± ∞ ¹   2.998Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithDeny-4                                 2.425Ki ± ∞ ¹   2.422Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
PriorityModel-4                                     1.724Ki ± ∞ ¹   1.724Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomainPatternLarge-4                   8.489Ki ± ∞ ¹   8.486Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RoleManagerSmall-4                                  11.67Ki ± ∞ ¹   11.67Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerMedium-4                                 123.0Ki ± ∞ ¹   123.0Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerLarge-4                                  1.287Mi ± ∞ ¹   1.287Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithPatternLarge-4                    85.80Mi ± ∞ ¹   85.81Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithDomainPatternLarge-4              4.483Mi ± ∞ ¹   4.486Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithPatternAndDomainPatternLarge-4    87.43Mi ± ∞ ¹   87.43Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
HasLinkWithPatternLarge-4                             176.0 ± ∞ ¹     176.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithDomainPatternLarge-4                       80.00 ± ∞ ¹     80.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternAndDomainPatternLarge-4             176.0 ± ∞ ¹     177.0 ± ∞ ¹       ~ (p=1.000 n=1) ³
ConcurrentHasLinkWithMatching-4                       622.0 ± ∞ ¹     622.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                         ⁴                  -0.06%               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

                                                 │ base-bench.txt │             pr-bench.txt             │
                                                 │   allocs/op    │  allocs/op    vs base                │
CachedRaw-4                                           0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedBasicModel-4                                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModel-4                                     4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelSmall-4                                4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMedium-4                               4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelLarge-4                                3.000 ± ∞ ¹    3.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithResourceRoles-4                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDomains-4                          4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedABACModel-4                                     18.00 ± ∞ ¹    18.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedKeyMatchModel-4                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDeny-4                             4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedPriorityModel-4                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedWithEnforceContext-4                            5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMediumParallel-4                       4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicySmall-4                                      6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyMedium-4                                     6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyLarge-4                                      7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicySmall-4                                      6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyMedium-4                                     7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyLarge-4                                      9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicySmall-4                                   7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyMedium-4                                  7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyLarge-4                                   8.000 ± ∞ ¹    8.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
Raw-4                                                 0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
BasicModel-4                                          17.00 ± ∞ ¹    17.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModel-4                                           35.00 ± ∞ ¹    35.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/small-4                                480.0 ± ∞ ¹    480.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/medium-4                              4.828k ± ∞ ¹   4.829k ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/large-4                               48.17k ± ∞ ¹   48.12k ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSmall-4                                      615.0 ± ∞ ¹    615.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelMedium-4                                    6.018k ± ∞ ¹   6.018k ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelLarge-4                                     60.30k ± ∞ ¹   60.30k ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithResourceRoles-4                          28.00 ± ∞ ¹    28.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomains-4                                25.00 ± ∞ ¹    25.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACModel-4                                           17.00 ± ∞ ¹    17.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACRuleModel-4                                      40.09k ± ∞ ¹   40.09k ± ∞ ¹       ~ (p=1.000 n=1) ³
KeyMatchModel-4                                       37.00 ± ∞ ¹    37.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDeny-4                                   49.00 ± ∞ ¹    49.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
PriorityModel-4                                       22.00 ± ∞ ¹    22.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomainPatternLarge-4                     72.00 ± ∞ ¹    72.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerSmall-4                                    797.0 ± ∞ ¹    797.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerMedium-4                                  8.741k ± ∞ ¹   8.741k ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerLarge-4                                   89.74k ± ∞ ¹   89.74k ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternLarge-4                     3.600M ± ∞ ¹   3.600M ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithDomainPatternLarge-4               145.2k ± ∞ ¹   145.2k ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithPatternAndDomainPatternLarge-4     3.679M ± ∞ ¹   3.679M ± ∞ ¹       ~ (p=1.000 n=1) ³
HasLinkWithPatternLarge-4                             13.00 ± ∞ ¹    13.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithDomainPatternLarge-4                       5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternAndDomainPatternLarge-4             13.00 ± ∞ ¹    13.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
ConcurrentHasLinkWithMatching-4                       21.00 ± ∞ ¹    21.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                         ⁴                 -0.00%               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

🤖 This comment will be automatically updated with the latest benchmark results.

@hsluoyz
Copy link
Member

hsluoyz commented Jan 6, 2026

@copilot don't modify go test file

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot don't modify go test file

Removed the test file modifications in commit a748589. The fix in model/assertion.go remains intact.

@hsluoyz hsluoyz changed the title Fix "Undefined function g" error by copying RM fields in Assertion.copy() fix: fix "Undefined function g" error by copying RM fields in Assertion.copy() Jan 6, 2026
@hsluoyz hsluoyz merged commit d727866 into master Jan 6, 2026
5 of 7 checks passed
hsluoyz added a commit that referenced this pull request Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undefined function g

3 participants