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

Change function identifier in profiling to fully qualified path #5306

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Change function identifier in profiling to fully qualified path #5306

merged 2 commits into from
Mar 22, 2024

Conversation

piotmag769
Copy link
Collaborator

@piotmag769 piotmag769 commented Mar 21, 2024

This change is Reviewable

@piotmag769 piotmag769 marked this pull request as draft March 21, 2024 16:06
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 5 files at r1, all commit messages.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @piotmag769)


crates/cairo-lang-runner/src/profiling_test_data/major_test_cases line 75 at r1 (raw file):

  function test::pow2_14000: 12
Weight by Cairo function:
  function unknown: 126021

seems there's some mishandling there.

Code quote:

  function unknown: 126021

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 5 files at r2, all commit messages.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @piotmag769)


crates/cairo-lang-semantic/src/test_utils.rs line 124 at r2 (raw file):

    let x = PathBuf::from("lib.cairo");
    std::fs::write(&x, content.as_bytes()).unwrap();
    let file_id = db.intern_file(FileLongId::OnDisk(x));

revert this.
just discover in the print case due to the missing Parent in the virtual file.
this may cause weird test collisions.

Code quote:

    let x = PathBuf::from("lib.cairo");
    std::fs::write(&x, content.as_bytes()).unwrap();
    let file_id = db.intern_file(FileLongId::OnDisk(x));

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 5 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @piotmag769)

Copy link
Collaborator Author

@piotmag769 piotmag769 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r1, 2 of 5 files at r2, 1 of 1 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-sierra-generator/src/statements_locations.rs line 28 at r4 (raw file):

            let file_name = file_id.file_name(db.upcast());

            while let FileLongId::Virtual(VirtualFile { parent: Some(parent), .. }) =

Will split this function to make sure the cases where:

  • parent for VirtualFile is missing
  • the ModuleId for real file is missing

are discoverable from the outside on the type level. These cases shouldn't happen but better to be safe than sorry.


crates/cairo-lang-semantic/src/test_utils.rs line 124 at r2 (raw file):

Previously, orizi wrote…

revert this.
just discover in the print case due to the missing Parent in the virtual file.
this may cause weird test collisions.

Accidentally committed

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion

@piotmag769 piotmag769 marked this pull request as ready for review March 22, 2024 12:47
Copy link
Collaborator Author

@piotmag769 piotmag769 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @piotmag769)


crates/cairo-lang-sierra-generator/src/statements_locations.rs line 28 at r4 (raw file):

Previously, piotmag769 (Piotr Magiera) wrote…

Will split this function to make sure the cases where:

  • parent for VirtualFile is missing
  • the ModuleId for real file is missing

are discoverable from the outside on the type level. These cases shouldn't happen but better to be safe than sorry.

Done

@mkaput mkaput enabled auto-merge March 22, 2024 14:18
@mkaput mkaput added this pull request to the merge queue Mar 22, 2024
Merged via the queue into starkware-libs:main with commit b3ecc57 Mar 22, 2024
43 checks passed
@piotmag769 piotmag769 deleted the stable-location-to-full-path-profiling branch March 23, 2024 14:52
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.

3 participants