Skip to content

Conversation

@Davphla
Copy link
Contributor

@Davphla Davphla commented Nov 17, 2025

Fix: #4777

DeepFill replace all references (RefValue) with concrete values loaded from storage.

StringValue, BigintValue, and BigdecValue are value types that are never persisted as separate objects. They lack ObjectInfo (ref gnovm/pkg/gnolang/ownership.go:144) and are used for:

  • Constant expressions (embedded in ConstExpr nodes during preprocessing)
  • Runtime untyped values (e.g., UntypedBigintType operations in gnovm/pkg/gnolang/op_binary.go:693)

Because these types are never persisted separately, they should never appear as RefValue that require DeepFill.
This is confirmed by their VisitAssociated implementations in gnovm/pkg/gnolang/garbage_collector.go:378-386, which return false indicating no associated values to visit during GC.

This PR adds debug-mode assertions that panic when DeepFill is called on these constant-only types, making it easier to catch incorrect handling of constant expressions during development.

@Gno2D2
Copy link
Collaborator

Gno2D2 commented Nov 17, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
  • The pull request description provides enough details
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)
🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: Davphla/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [jefft0 leohhhn n0izn0iz notJoon omarsy x1unix] (with state "APPROVED")
    │       ├── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🟢 This pull request is a draft
    └── 🟢 Then
        └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)
    └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])

Can be checked by

  • team core-contributors

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gnovm/pkg/gnolang/values_fill.go 0.00% 3 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@Davphla Davphla marked this pull request as ready for review November 17, 2025 15:13
@Davphla Davphla moved this from In progress to NEED PEER REVIEW (INTERNAL) in FlashorgSprint: Gnocore Minicrew 🥷 Nov 17, 2025
@Gno2D2 Gno2D2 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 17, 2025
@Kouteki Kouteki moved this from Triage to In Review in 🧙‍♂️gno.land core team Nov 24, 2025
@MikaelVallenet MikaelVallenet moved this from NEED PEER REVIEW (INTERNAL) to Waiting for core Review in FlashorgSprint: Gnocore Minicrew 🥷 Nov 25, 2025
@jefft0
Copy link
Contributor

jefft0 commented Nov 27, 2025

Hi @Davphla . Can you fix the failed CI check for codecov?

@Davphla
Copy link
Contributor Author

Davphla commented Nov 27, 2025

I've added minimal tests. Since added lines cover debug features and CI doesn't run in debug mode, further coverage isn't possible.

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say just make them panic, in correct code this adds no overhead anyway (because DeepFill is often called through an interface, not lending itself to optimization). So might as well always panic.

Comment on lines 8 to 27
func (sv StringValue) DeepFill(store Store) Value {
if debug {
panic("StringValue.DeepFill should not be called - StringValue is only used for constant expressions")
}
return sv
}

func (biv BigintValue) DeepFill(store Store) Value {
if debug {
panic("BigintValue.DeepFill should not be called - BigintValue is only used for constant expressions")
}
return biv
}

func (bdv BigdecValue) DeepFill(store Store) Value {
if debug {
panic("BigdecValue.DeepFill should not be called - BigdecValue is only used for constant expressions")
}
return bdv
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just make these panic?

Copy link
Contributor Author

@Davphla Davphla Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may cause involuntary informational panic, so I think it is safer to have a potential optimization then an accidental panic.

As well, it break tests 2b0ae1d
Failing test: https://github.com/gnolang/gno/actions/runs/19742512315/job/56569620776#step:5:10

Should the failing tests be considered in that PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not intended to happen, then it won't be "informational".

But by seeing the test results, it looks like either the behaviour is incorrect in the callers; or it would be incorrect to have a panic here

@Gno2D2 Gno2D2 removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 27, 2025
@Davphla Davphla marked this pull request as draft November 29, 2025 08:31
@Kouteki Kouteki requested a review from jaekwon November 29, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 🤖 gnovm Issues or PRs gnovm related

Projects

Status: In Progress
Status: In Review

Development

Successfully merging this pull request may close these issues.

Concerns regarding the DeepFill method

6 participants