Repository navigation
Conversation
Absent libc import yrx+40YKqiI (timespec_get); fill realtime UTC like _Xtime_get_ticks. Co-authored-by: Cursor <cursoragent@cursor.com>
The guest timespec has two 64-bit fields, but the host timespec on Windows has a 32-bit tv_nsec, so only the low half of the nanoseconds was written. Take a guest struct and write both fields; the test pre-fills the struct so a 32-bit write fails. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
| GuestTimespec later{-1, -1}; | ||
| Require(timespec_get_nid_postfix(&later, TIME_UTC) == TIME_UTC); | ||
| Require(later.tv_nsec >= 0 && later.tv_nsec < 1000000000LL); | ||
| Require(later.tv_sec > filled.tv_sec || (later.tv_sec == filled.tv_sec && later.tv_nsec >= filled.tv_nsec)); |
There was a problem hiding this comment.
This second-read ordering check assumes UTC wall-clock time is monotonic. Both clock_gettime(CLOCK_REALTIME) and GetSystemTimePreciseAsFileTime can move backward after an administrator/NTP clock correction, so the test can fail even when timespec_get correctly returns UTC. Please avoid comparing two wall-clock reads, or bound the result against an independently sampled wall clock with an allowance that does not require monotonicity.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed both retained commits and the guest-layout fix. The KernelTimespec fields are written explicitly, and the test now pre-fills the 16-byte guest layout so the MinGW-width regression is observable. The commits retain their original contributor authorship, and the PR describes the superseding relationship to #6084. Hosted eligibility, intake, conventions, relinker and test-support checks are green. I left a non-blocking inline note about the test comparing two UTC wall-clock reads, which can move backward after clock correction.
|
Linux run of the current head (the Linux run on #6084 predates the Head
AI-assisted: yes (Claude Code); results above were run on this machine. |
|
I rechecked this head against current One coordination item surfaced since the prior review: open #9447 also changes |
|
Title run for the "Not tested: a title run" item, EA SPORTS FC 27 (PPSA34015, 01.000.004). Setup: Windows 11 (build 26200), RTX 5090, driver 617.42, Result: the title reaches One thing I had to work around, not caused by this PR: on current main this title aborts 1.8 s in, before it can call AI-assisted: yes. Written with AI assistance and reviewed by me. |
|
@MarcZX10 thanks for rechecking. On the order with #9447 (@AlxcBTW): both PRs change @AlxcBTW: do you prefer #9447 to go first or second? If it helps, I can prepare a rebased branch of either side in my fork (authorship kept) for you to take over or ignore. On the base being 1039 commits behind: a rebase gives a new head; I would rebase right before the merge or when you ask, and then ask for a look at the new head. |
|
Closing this as a duplicate of #6084, which implements the same timespec_get and was opened first. Thanks, and sorry for the overlap. |
What
Carries #6084 (@notaxeltv) onto current
main, as @oneandonlydean announced there on 20.10. (24 h without a reply from the author, keeping both commits and crediting both). #6084's commit implements C11timespec_getforTIME_UTC(importyrx+40YKqiIof PPSA34015, listed bytools/import_audit.py) with the realtime source of_Xtime_get_ticks, returning 0 for a null pointer or an unsupported base. The second commit resolves the review point on #6084: it writes the guest's 16-bytetimespec(two 64-bit fields,KernelTimespec), not the hosttimespec, whosetv_nsecis 32 bits on MinGW, and the test pre-fills a guest struct with a non-zero pattern so a 32-bit write fails. Based on the heads of #6084 andxXPBSXx:fix/timespec-get-guest-layout.Tested
Windows 10 19045, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, onmainea241c0 with both commits merged (the rebased head only differs by its newer base):ctest -R '^guest_timespec_get$'passes 3 of 3;guest_time_conversionandguest_mktimepass (3 of 3 together).libc/src/Time.cpprestored tomainthe test does not link (undefined reference to timespec_get_nid_postfix). On feat(libc): implement C11 timespec_get (PPSA34015) #6084's head alone the layout case fails 3 of 3 (0xc0000409), as @xXPBSXx posted there on 20.10.python tools/check_conventions.py --base upstream/mainpasses;git merge-treeagainstmainis clean.APS5_PLAYGO_UNLISTED_CHUNKS=absent,main1a745ae38eplus feat(libc): write the called imports to APS5_TRACE_CALLS_FILE every 10 seconds #9439 (to record calls) plus this PR's headd9d01fa01, merged. The title reachestimespec_getand keeps running:libc.prx yrx+40YKqiIis called 19,588 times in a 2-minute run that ends only because it was stopped (no crash, noNotImplemented). That reporter did not runmainwithout this PR past an unrelated keyboard abort, so what the missing import does there is not shown; and the run needed a local-only revert ofsceConvertKeycodeGetImeKeyboardType(not part of this PR), because currentmainaborts that title 1.8 s in.Checklist
main; no other open PR implements the same functions (feat(libc): implement C11 timespec_get (PPSA34015) #6084 is the one this carries; it can be closed as superseded once this merges).mdfiles or images added to the repositorytimespec_get)AI-assisted (Claude Code).