Skip to content

Track kernel function definition locations more precisely#6427

Open
fingolfin wants to merge 2 commits into
masterfrom
codex/gvar-definition-lines
Open

Track kernel function definition locations more precisely#6427
fingolfin wants to merge 2 commits into
masterfrom
codex/gvar-definition-lines

Conversation

@fingolfin
Copy link
Copy Markdown
Member

Resolve C definition lines lazily for standard GVAR-backed kernel functions. The result is cached, and used for StartlineFunc and PageSource.

Before:

gap> LocationFunc(RETURN_FIRST);
"src/gap.c:RETURN_FIRST"

After:

gap> LocationFunc(RETURN_FIRST);
"GAPROOT/src/gap.c:448"

This then allows us to drop the now unused LOCATION_BODY accessors, rename the shared body field to startline, and remove the leftover empty-string initialization for undefined global functions.

AI-assisted: OpenAI Codex was used to implement the change and prepare the regression coverage.


I actually wrote this back in April but then didn't want to bother spending time to get this merged.

Resolve C definition lines lazily for standard GVAR-backed kernel
functions. The result is cached, and used for StartlineFunc and
PageSource.

Before:

    gap> LocationFunc(RETURN_FIRST);
    "src/gap.c:RETURN_FIRST"

After:

    gap> LocationFunc(RETURN_FIRST);
    "GAPROOT/src/gap.c:448"

This then allows us to drop the now unused LOCATION_BODY
accessors, rename the shared body field to startline, and remove
the leftover empty-string initialization for undefined global
functions.

AI-assisted: OpenAI Codex was used to implement the change and
prepare the regression coverage.

Co-authored-by: Codex <codex@openai.com>
@fingolfin fingolfin requested a review from ChrisJefferson June 5, 2026 17:10
@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: error handling labels Jun 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 72.82609% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.08%. Comparing base (74a43d6) to head (f30b6bd).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/calls.c 73.25% 23 Missing and 23 partials ⚠️
src/modules.c 66.66% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6427      +/-   ##
==========================================
- Coverage   78.86%   76.08%   -2.79%     
==========================================
  Files         685      642      -43     
  Lines      293551   278443   -15108     
  Branches     8672     7858     -814     
==========================================
- Hits       231519   211848   -19671     
- Misses      60225    65020    +4795     
+ Partials     1807     1575     -232     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lgoettgens
Copy link
Copy Markdown
Member

CI unfortunately fails. I can have a look once this is green

Also tweak PrintKernelFunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: error handling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants