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

TypeGraph: Create dummy containers #185

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

ajor
Copy link
Contributor

@ajor ajor commented Jun 26, 2023

These represent types which don't store any interesting data for us to measure, but which are required by a real container so can not be replaced with our own generated class types.

std::allocator often has bad DWARF, so it must be replaced after the DWARF is fixed up in Flattener. The others could be replaced earlier in the transformation process if desired, but I've left them all together for simplicity for now.

This fixes the folly::fbstring tests.

@ajor ajor force-pushed the allocator-pass-through branch 3 times, most recently from 8fc35cb to ea1c442 Compare June 28, 2023 08:38
@ajor
Copy link
Contributor Author

ajor commented Jun 28, 2023

I also included a fix for the failing code coverage in this PR - see commit message for details

@ajor ajor marked this pull request as ready for review June 28, 2023 08:50
@codecov-commenter
Copy link

Codecov Report

Merging #185 (ea1c442) into main (4dc9007) will increase coverage by 63.82%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##            main     #185       +/-   ##
==========================================
+ Coverage   0.48%   64.31%   +63.82%     
==========================================
  Files         73       87       +14     
  Lines       6817     9429     +2612     
  Branches    1049     1553      +504     
==========================================
+ Hits          33     6064     +6031     
+ Misses      6777     2542     -4235     
- Partials       7      823      +816     
Impacted Files Coverage Δ
oi/type_graph/TypeIdentifier.h 100.00% <ø> (+100.00%) ⬆️
oi/ContainerInfo.cpp 52.53% <50.00%> (+52.53%) ⬆️
oi/type_graph/TypeIdentifier.cpp 96.15% <100.00%> (+96.15%) ⬆️

... and 79 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

ajor added 2 commits June 28, 2023 01:56
These represent types which don't store any interesting data for us to
measure, but which are required by a real container so can not be
replaced with our own generated class types.

std::allocator often has bad DWARF, so it must be replaced after the
DWARF is fixed up in Flattener. The others could be replaced earlier in
the transformation process if desired, but I've left them all together
for simplicity for now.

This fixes the folly::fbstring tests.
Multiple jobs are not allowed to persist the same files to a workspace.

This commit takes the lazy approach of splitting the type-graph and
non-type-graph jobs into different workspaces and creating a second
coverage job to avoid the conflict.
@ajor ajor force-pushed the allocator-pass-through branch from ea1c442 to 30af9f1 Compare June 28, 2023 08:56
@@ -20,6 +20,15 @@

namespace type_graph {

// TODO:
// - read these from a TOML file
Copy link
Contributor

Choose a reason for hiding this comment

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

can you create an issue for putting these in the config or creating container .tomls for them? I'd lean towards the config for simplicity but either works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed that just putting these in the config would be simpler - no need for a file for each

@@ -20,6 +20,15 @@

namespace type_graph {

// TODO:
// - read these from a TOML file
// - don't require specifying ctype and header
Copy link
Contributor

Choose a reason for hiding this comment

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

do you not need to specify the headers here? you could use "cstddef" in that case which is always included, but it looks to me like you do need the headers in weird edge cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each of these dummy containers belongs to a real container and will only appear when that container is used. That means their header files will already be included by the real container.

Actually, typing this out has made me think that maybe "dummy container" should be a field in the container TOML of each real container that these belong to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, except std::allocator, which doesn't belong to any single container, but is used by all of them

@JakeHillion
Copy link
Contributor

Codecov Report

Merging #185 (ea1c442) into main (4dc9007) will increase coverage by 63.82%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##            main     #185       +/-   ##
==========================================
+ Coverage   0.48%   64.31%   +63.82%     
==========================================
  Files         73       87       +14     
  Lines       6817     9429     +2612     
  Branches    1049     1553      +504     
==========================================
+ Hits          33     6064     +6031     
+ Misses      6777     2542     -4235     
- Partials       7      823      +816     

Impacted Files Coverage Δ
oi/type_graph/TypeIdentifier.h 100.00% <ø> (+100.00%) ⬆️
oi/ContainerInfo.cpp 52.53% <50.00%> (+52.53%) ⬆️
oi/type_graph/TypeIdentifier.cpp 96.15% <100.00%> (+96.15%) ⬆️

... and 79 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Is 91.66% accurate? I'm amazed!

@ajor
Copy link
Contributor Author

ajor commented Jun 28, 2023

Is 91.66% accurate? I'm amazed!

We're at 100% coverage for the majority of type_graph files so I'd assume so!

@ajor ajor merged commit 26fd44c into facebookexperimental:main Jun 28, 2023
@ajor ajor deleted the allocator-pass-through branch June 28, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants