mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #2336] pipeline_wait: guard non-positive window and signed subtraction overflow in title_submitting #2340
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2340
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2336
Author: @narekshaghoyandev
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:ubiq-pipeline-wait-window📝 Commits (1)
1be69fdpipeline_wait: guard non-positive window and signed subtraction overflow in title_submitting📊 Changes
2 files changed (+45 additions, -1 deletions)
View changed files
📝
runtime/src/pipeline_wait.h(+4 -1)➕
runtime/test/pipeline_wait_test.cpp(+41 -0)📄 Description
Fixes window and signed-integer subtraction bugs in
leonida::pipeline_wait::title_submitting()(runtime/src/pipeline_wait.h):falseimmediately whenwithin_ns <= 0(previously, if another thread stored a timestamp slightly ahead ofnow_ns(),now_ns() - lastwas negative and< 0, returningtrueeven for a zero/negative window).falsewhenlast <= 0, avoiding signed 64-bit subtraction overflow UB (now_ns() - INT64_MIN).now < last || now - last < within_nsso the subtraction only runs whennow >= last > 0.runtime/test/pipeline_wait_test.cpp.Verification
g++ -std=c++20 -D_GLIBCXX_DEBUG -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/pipeline_wait_test.cpppassedg++ -std=c++20 -fsanitize=address,undefined -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/pipeline_wait_test.cpppassed!title_submitting(0), exit 1) against unmodifiedubiq/mainpython3 -I scripts/check_no_game_data.py runtime/src/pipeline_wait.h runtime/test/pipeline_wait_test.cppcleanClaimed in the coordination issue as: RT-PIPELINE-WAIT-SIGNED-SUB-AND-WINDOW (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7194149264)
AI-assisted: yes (Gemini)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.