René's URL Explorer Experiment


Title: Python: inline init_module_submodule_defn into ImportResolution by yoff · Pull Request #21930 · github/codeql · GitHub

Open Graph Title: Python: inline init_module_submodule_defn into ImportResolution by yoff · Pull Request #21930 · github/codeql

X Title: Python: inline init_module_submodule_defn into ImportResolution by yoff · Pull Request #21930 · github/codeql

Description: Factored out of #21925 (shared-CFG migration). The new-dataflow ImportResolution module only imported semmle.python.essa.SsaDefinitions to call the 5-line helper SsaSource::init_module_submodule_defn. Inlining it locally drops the dependency on legacy SSA definitions — making new/internal/ImportResolution.qll independent of essa/. Semantic-noop argument SsaSourceVariable.getName() and Variable.getId() both project the same DB column variable(_, _, result), so the rename in the inlined body is safe. The old call init_module_submodule_defn(var.getSourceVariable(), package.getEntryNode()) constrained init = package via the join init.getEntryNode() = package.getEntryNode() plus var.getScope() = init. With Scope.getEntryNode() being functional, this is equivalent to passing package directly. The var instanceof GlobalVariable check in the old body is now expressed via the parameter type. Verification RA dump of python/ql/test/library-tests/dataflow/global-flow/accesses.ql shows only the expected predicate-rename shuffle (no semantic shape change in any other predicate). All 70 tests under python/ql/test/library-tests/dataflow and python/ql/test/library-tests/ApiGraphs pass without reblessing. Investigation note (negative result worth recording) I had originally hoped to fold two other ESSA-bypass rewrites into this PR — switching definitionFlowStep from AssignmentDefinition to DefinitionNode + NameNode, and switching ModuleVariableNode.getAWrite from EssaNodeDefinition.definedBy to NameNode.defines — but they are not semantic noops on main. Old ESSA's EssaNodeDefinition (and hence AssignmentDefinition) is liveness-pruned at SsaCompute.qll:108-113, so bypassing it reintroduces dead writes. accesses.ql immediately picks up the dead g_mod = [] line. Those rewrites have to stay on the flip PR (#21925) where they're justified by the shared-SSA prune semantics. Stacked under #21926.

Open Graph Description: Factored out of #21925 (shared-CFG migration). The new-dataflow ImportResolution module only imported semmle.python.essa.SsaDefinitions to call the 5-line helper SsaSource::init_module_submodule_de...

X Description: Factored out of #21925 (shared-CFG migration). The new-dataflow ImportResolution module only imported semmle.python.essa.SsaDefinitions to call the 5-line helper SsaSource::init_module_submodule_de...

Opengraph URL: https://github.com/github/codeql/pull/21930

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:893a0b07-2d9c-78c3-269d-dd38b8f1df6f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9350:3EE845:838BFF4:B7CB3B6:6A50117B
html-safe-nonce869a742fcf8aade3c437841a653462e46305a9e2c053bfc2d1df7851022ea46a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzUwOjNFRTg0NTo4MzhCRkY0OkI3Q0IzQjY6NkE1MDExN0IiLCJ2aXNpdG9yX2lkIjoiMzgxMDE1MTkxMzM5NzE2MjM2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7219126e2687ee288b08ed99f66273bc4ce8f0d44cec4adda216783629d78457
hovercard-subject-tagpull_request:3786644077
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql/pull/21930/files
twitter:imagehttps://avatars.githubusercontent.com/u/647347?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/647347?s=400&v=4
og:image:altFactored out of #21925 (shared-CFG migration). The new-dataflow ImportResolution module only imported semmle.python.essa.SsaDefinitions to call the 5-line helper SsaSource::init_module_submodule_de...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonefe4f38b24922a1ce81c1708c3793b47c185599b9144ab94f6ca846b00698058d
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql git https://github.com/github/codeql.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id143040428
octolytics-dimension-repository_nwogithub/codeql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id143040428
octolytics-dimension-repository_network_root_nwogithub/codeql
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release42b6390c91978a16f9196c38c7a00e9bf21f37e7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql/pull/21930/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F21930%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F21930%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql
Reloadhttps://github.com/github/codeql/pull/21930/files
Reloadhttps://github.com/github/codeql/pull/21930/files
Reloadhttps://github.com/github/codeql/pull/21930/files
Please reload this pagehttps://github.com/github/codeql/pull/21930/files
github https://github.com/github
codeqlhttps://github.com/github/codeql
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql
Fork 2k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Star 9.8k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Code https://github.com/github/codeql
Issues 987 https://github.com/github/codeql/issues
Pull requests 428 https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality 0 https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Code https://github.com/github/codeql
Issues https://github.com/github/codeql/issues
Pull requests https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
yoffhttps://github.com/yoff
mainhttps://github.com/github/codeql/tree/main
yoff/python-dataflow-noop-simplificationshttps://github.com/github/codeql/tree/yoff/python-dataflow-noop-simplifications
Conversation 6 https://github.com/github/codeql/pull/21930
Findings https://github.com/github/codeql/pull/21930/findings
Commits 1 https://github.com/github/codeql/pull/21930/commits
Checks 9 https://github.com/github/codeql/pull/21930/checks
Files changed 1 https://github.com/github/codeql/pull/21930/files
Python: inline init_module_submodule_defn into ImportResolution https://github.com/github/codeql/pull/21930/files#top
Show all changes 1 commit https://github.com/github/codeql/pull/21930/files
ac5fa62 Python: inline init_module_submodule_defn into ImportResolution yoff Jun 2, 2026 https://github.com/github/codeql/pull/21930/commits/ac5fa629ef495c8d5d70b270b4d65ad34eb1481c
Clear filters https://github.com/github/codeql/pull/21930/files
Please reload this pagehttps://github.com/github/codeql/pull/21930/files
Please reload this pagehttps://github.com/github/codeql/pull/21930/files
https://github.com/github/codeql/blob/main/CODEOWNERS#L19
python/ql/lib/semmle/python/dataflow/new/internal/ImportResolution.qllhttps://github.com/github/codeql/pull/21930/files#diff-607d5fd09c68e4fda9f60d4fbea85753012f01f1395f44535ca6c4c42e9c17ca
View file https://github.com/github/codeql/blob/ac5fa629ef495c8d5d70b270b4d65ad34eb1481c/python/ql/lib/semmle/python/dataflow/new/internal/ImportResolution.qll
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/21930/{{ revealButtonHref }}
https://github.com/github/codeql/pull/21930/files#diff-607d5fd09c68e4fda9f60d4fbea85753012f01f1395f44535ca6c4c42e9c17ca
https://github.com/github/codeql/pull/21930/files#diff-607d5fd09c68e4fda9f60d4fbea85753012f01f1395f44535ca6c4c42e9c17ca
https://github.com/github/codeql/pull/21930/files#diff-607d5fd09c68e4fda9f60d4fbea85753012f01f1395f44535ca6c4c42e9c17ca
https://github.com/github/codeql/pull/21930/files#diff-607d5fd09c68e4fda9f60d4fbea85753012f01f1395f44535ca6c4c42e9c17ca
Please reload this pagehttps://github.com/github/codeql/pull/21930/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.