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

Encode constraints that hold at all points as logical edges in location-sensitive polonius #135290

Merged
merged 2 commits into from
Jan 18, 2025

Conversation

lqd
Copy link
Member

@lqd lqd commented Jan 9, 2025

Currently, with the full setup in #134980 (but is from #134268), the polonius location-sensitive analysis converts Locations::All typeck constraints as edges at all points in the CFG. This was temporary.

There's a FIXME about that already, and this PR implements it: we now use the constraints that hold at all points during traversal instead of eagerly materializing them as physical edges.

Another easy one @jackh726.

This fixes the slowness that was happening on the big CFG from the saturating-float-casts test (because of its 12M materialized edges) without, AFAICT, simply moving this overhead to traversal: materializing the logical edges is done on-demand.

r? @jackh726 (no rush either)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 9, 2025
@lqd lqd force-pushed the polonius-next-episode-8 branch from da1a5ae to fbaebf6 Compare January 17, 2025 08:18
lqd added 2 commits January 17, 2025 11:52
this prepares the code structure for adding logical edges to the graph next
Instead of materializing `Locations::All` constraints as physical edges
at all the points in the CFG, we record them as logical edges and only
materialize them during traversal as successors for a given node.

This fixes the slowness/hang in the `saturating-float-casts.rs` test.
@lqd lqd force-pushed the polonius-next-episode-8 branch from fbaebf6 to dee52a3 Compare January 17, 2025 12:13
@lqd
Copy link
Member Author

lqd commented Jan 17, 2025

Ready now that #134980 has landed.

@lqd lqd marked this pull request as ready for review January 17, 2025 12:25
@jackh726
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 17, 2025

📌 Commit dee52a3 has been approved by jackh726

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 17, 2025
@bors
Copy link
Contributor

bors commented Jan 18, 2025

⌛ Testing commit dee52a3 with merge ec2633a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2025
Encode constraints that hold at all points as logical edges in location-sensitive polonius

Currently, with the full setup in rust-lang#134980 (but is from rust-lang#134268), the polonius location-sensitive analysis converts `Locations::All` typeck constraints as edges at all points in the CFG. This was temporary.

There's a FIXME about that already, and this PR implements it: we now use the constraints that hold at all points during traversal instead of eagerly materializing them as physical edges.

Another easy one `@jackh726.`

This fixes the slowness that was happening on the big CFG from the `saturating-float-casts` test (because of its 12M materialized edges) without, AFAICT, simply moving this overhead to traversal: materializing the logical edges is done on-demand.

r? `@jackh726` (no rush either)
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-fuchsia failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
+ .jiri_root/bin/jiri import -name=integration -revision=bb38af4e3d45e490531b71fc52a460003141d032 -overwrite=true flower https://fuchsia.googlesource.com/integration
+ '[' -d .git ']'
+ .jiri_root/bin/jiri update -autoupdate=false
[05:23:47.296] Updating all projects
ERROR: 'git clone --no-checkout --filter=blob:none https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km /checkout/obj/fuchsia/third_party/imgtec-pvr-rgx-km' failed:

stderr:
stderr:
Cloning into '/checkout/obj/fuchsia/third_party/imgtec-pvr-rgx-km'...
fatal: repository 'https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km/' not found
command fail error: exit status 128


[05:25:21.412] Wait for 1m4s before next attempt...: Cloning https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km

[05:26:25.435] Attempt 2/3: Cloning https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km

[05:26:25.514] Wait for 1m4s before next attempt...: Cloning https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km

ERROR: 'git clone --no-checkout --filter=blob:none https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km /checkout/obj/fuchsia/third_party/imgtec-pvr-rgx-km' failed:

stderr:
stderr:
Cloning into '/checkout/obj/fuchsia/third_party/imgtec-pvr-rgx-km'...
fatal: repository 'https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km/' not found
command fail error: exit status 128


[05:27:29.578] Attempt 3/3: Cloning https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km

[05:27:29.655] Jiri packages are not fetched due to fatal errors when updating projects.
[05:27:29.655] Jiri hooks are not run due to fatal errors when updating projects or packages
ERROR: Creating project "third_party/imgtec-pvr-rgx-km": "Cloning https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km" failed 3 times in a row, Last error: 'git clone --no-checkout --filter=blob:none https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km /checkout/obj/fuchsia/third_party/imgtec-pvr-rgx-km' failed:

stderr:
stderr:
Cloning into '/checkout/obj/fuchsia/third_party/imgtec-pvr-rgx-km'...
fatal: repository 'https://fuchsia.googlesource.com/third_party/imgtec-pvr-rgx-km/' not found
command fail error: exit status 128
  local time: Sat Jan 18 05:27:29 UTC 2025
  network time: Sat, 18 Jan 2025 05:27:29 GMT
##[error]Process completed with exit code 1.

@bors
Copy link
Contributor

bors commented Jan 18, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 18, 2025
@ehuss
Copy link
Contributor

ehuss commented Jan 18, 2025

@bors retry

fuchsia not working

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 18, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133700 (const-eval: detect more pointers as definitely not-null)
 - rust-lang#135290 (Encode constraints that hold at all points as logical edges in location-sensitive polonius)
 - rust-lang#135478 (Run clippy for rustc_codegen_gcc on CI)
 - rust-lang#135583 (Move `std::pipe::*` into `std::io`)
 - rust-lang#135612 (Include x scripts in tarballs)
 - rust-lang#135624 (ci: mirror buildkit image to ghcr)
 - rust-lang#135661 (Stabilize `float_next_up_down`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 56447d7 into rust-lang:master Jan 18, 2025
6 of 7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 18, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2025
Rollup merge of rust-lang#135290 - lqd:polonius-next-episode-8, r=jackh726

Encode constraints that hold at all points as logical edges in location-sensitive polonius

Currently, with the full setup in rust-lang#134980 (but is from rust-lang#134268), the polonius location-sensitive analysis converts `Locations::All` typeck constraints as edges at all points in the CFG. This was temporary.

There's a FIXME about that already, and this PR implements it: we now use the constraints that hold at all points during traversal instead of eagerly materializing them as physical edges.

Another easy one `@jackh726.`

This fixes the slowness that was happening on the big CFG from the `saturating-float-casts` test (because of its 12M materialized edges) without, AFAICT, simply moving this overhead to traversal: materializing the logical edges is done on-demand.

r? `@jackh726` (no rush either)
@lqd lqd deleted the polonius-next-episode-8 branch January 18, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants