Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jstz_engine): define the Trace and Finalize traits #662

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

johnyob
Copy link
Collaborator

@johnyob johnyob commented Nov 14, 2024

Context

We'll need to trace native Rust objects. To do so, we'll need a Trace trait (and a Finalize for drops)

Description

This PR:

  • Defines the Trace and Finalize traits + some helpful macros
  • Implements the Trace and Finalize trait for many common types.

Manually testing the PR

Code isn't easily testable (relies on calling out to SM GC where Tracer is defined). I suggest we ignore the codecov check for this PR -- these implementations will become tested as we implement APIs on top of them

@johnyob johnyob self-assigned this Nov 14, 2024
@johnyob johnyob force-pushed the ajob410@jstz-194-add-gcptr branch 4 times, most recently from e911862 to 96d3d75 Compare November 27, 2024 18:03
@johnyob johnyob force-pushed the ajob410@jstz-195-tracing branch 2 times, most recently from 25ee901 to f55488f Compare November 27, 2024 18:32
@johnyob johnyob requested a review from zcabter November 27, 2024 18:35
@johnyob johnyob marked this pull request as ready for review November 27, 2024 18:36
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 185 lines in your changes missing coverage. Please review.

Project coverage is 45.30%. Comparing base (96d3d75) to head (f55488f).

Files with missing lines Patch % Lines
crates/jstz_engine/src/gc/trace.rs 0.00% 182 Missing ⚠️
crates/jstz_engine/src/gc/ptr.rs 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
crates/jstz_engine/src/gc/ptr.rs 50.76% <0.00%> (-1.20%) ⬇️
crates/jstz_engine/src/gc/trace.rs 4.67% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96d3d75...f55488f. Read the comment docs.

@johnyob johnyob assigned zcabter and unassigned johnyob Nov 27, 2024
@johnyob johnyob force-pushed the ajob410@jstz-194-add-gcptr branch from 96d3d75 to 94ddd2c Compare December 11, 2024 14:29
@johnyob johnyob force-pushed the ajob410@jstz-195-tracing branch from f55488f to dd196ea Compare December 11, 2024 14:30
@johnyob johnyob force-pushed the ajob410@jstz-194-add-gcptr branch from 6a9c971 to d874eaf Compare December 19, 2024 09:52
Base automatically changed from ajob410@jstz-194-add-gcptr to main December 19, 2024 10:04
zcabter
zcabter previously approved these changes Dec 20, 2024
Copy link
Collaborator

@zcabter zcabter left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@zcabter zcabter left a comment

Choose a reason for hiding this comment

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

Finalize implementation seems to be left empty throughout and also is left empty in the follow up PR (https://github.com/jstz-dev/jstz/pull/680/files). Am I missing something here? Do we need it?

@zcabter zcabter dismissed their stale review December 20, 2024 03:11

Left a few comments

@zcabter zcabter assigned johnyob and unassigned zcabter Dec 20, 2024
@johnyob
Copy link
Collaborator Author

johnyob commented Dec 20, 2024

Finalize implementation seems to be left empty throughout and also is left empty in the follow up PR (https://github.com/jstz-dev/jstz/pull/680/files). Am I missing something here? Do we need it?

The interesting logic for Finalize will be implemented in https://linear.app/tezos/issue/JSTZ-197/call-finalizeers-when-gcing

@johnyob johnyob force-pushed the ajob410@jstz-195-tracing branch from f0af742 to 174b36c Compare December 20, 2024 14:47
This commit also implements the `Trace` and `Finalize` trait for many common types.
@johnyob johnyob force-pushed the ajob410@jstz-195-tracing branch from 174b36c to 925a0c6 Compare December 20, 2024 14:47
@johnyob johnyob requested a review from zcabter December 20, 2024 14:48
@johnyob johnyob assigned zcabter and unassigned johnyob Dec 20, 2024
@zcabter zcabter assigned johnyob and unassigned zcabter Dec 21, 2024
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.

2 participants