Repository navigation
feat(libSceConvertKeycode): implement sceConvertKeycodeGetCharacterFromKeyboardData - #10437
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The implementation uses the existing ConvertCharacter path and bounds the array index by both KeyboardData::length and KEYBOARD_MAX_KEYCODES, which is the right shape for avoiding an out-of-bounds read. I found two items to resolve before this is ready:
- The required PR template is not filled in. The hosted
conventionscheck fails on this exact head becauseWhat,Tested, andChecklistare missing. Please copy.github/pull_request_template.mdinto the body, preserve every line, and complete the required fields (includingDepends on,Unblocks,GPUs tested, andAI-assisted). - No regression test was added for the new export. Please exercise a normal conversion and the boundary cases introduced here (null
keyData/output, negative index, index at/abovelength, and alengthlarger than the fixed 16-entry array). The existingsceConvertKeycodeGetCharacterbehavior provides the conversion path, but does not test this entry point's data and index validation.
I checked the exact diff and the existing KeyboardData definition: length is signed and key_code has 16 entries, so both bounds are relevant. I did not find a public primary source establishing additional console-specific error semantics, and I am not claiming hardware verification. The hosted conventions failure is directly reproducible from the reported check log; product tests have not run for this change.
2a6b9dd to
9870149
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Thanks for completing the required PR template; the conventions check now passes on head 9870149ee560936b299da388e7453099c2f73d95.
The implementation change is otherwise unchanged, and I still do not see regression tests for the new export. The PR now reports “Tested on Windows 11 host” but does not identify a test command or test cases; the hosted checks shown for this head are conventions and labels only. Please add focused coverage for a normal conversion and the validation paths introduced here: null keyData, null output, negative index, index equal to length, index at the 16-entry array bound, and a declared length greater than 16. This makes the pointer/index behavior reviewable and checks that the shared ConvertCharacter helper receives the selected keycode.
I did not run a local product test: CMake configuration stops because SDL2 development package configuration is missing. The exact current diff and the existing signed-length/16-element KeyboardData definition were reviewed.
2f4ae6c to
3b0bf99
Compare
|
@MarcZX10 Focused regression tests added in |
|
Built and verified on Linux (Ubuntu 24.04 on WSL2, GCC 13.3.0, AMD Ryzen 7 9800X3D):
Clean completion of the module exports. LGTM! |
Progress report (750cf6c → 0a07101)📈 System libraries: 46.66% (+0.01%, +1 implemented functions) ✅ 1 implemented
Changed libraries (implemented exports)
|
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the tests. Items before this can merge:
core/libs/prx/libSceConvertKeycode/Export.cpp:2442-2444: the result for an index outsidekeyData->length/KEYBOARD_MAX_KEYCODESiskErrInvalidAddress, but none of the references (shadPS4, fpPS4 only list the name; KytyPS5 and prosper don't implement it) give the real error code or validation order. Please cite where it comes from, or throw for that case and record it indocs/dev/debt/libSceConvertKeycode.md.Export.cpp:2441: the newkeyboardType >= 31throw is not covered by the test, and the debt file only namesGetVirtualKeycodeandGetCharacter; addsceConvertKeycodeGetCharacterFromKeyboardDatathere.- The branch conflicts with
mainincore/libs/tests/GuestConvertKeycode.cpp(adjacent test additions); please rebase.
|
@InfinitySpeed thanks. Two small things for
|
9336d16 to
0a07101
Compare
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Thanks for the PR. The
Merged. |
Resolves the debt-entry conflict with boykopovar#10437 and applies the same layout rules to sceConvertKeycodeGetCharacterFromKeyboardData. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@adriadam10 heads-up: this merge (f48ef6a) brought three submodule pointers back to older revisions on
Each "now" value is exactly the value from before the change it undoes ( The fix is to set the three pointers back to AI-assisted: yes (Claude Code) |
|
@adriadam10 opened as #13053 (the three gitlinks only). TechLevelZero's NVIDIA CI on #11265 shows the effect: AI-assisted: yes (Claude Code) |
f48ef6a (#10437) brought back the pointers from before 03bc1d1 and d21fb10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV
What
Implement
sceConvertKeycodeGetCharacterFromKeyboardDatainlibSceConvertKeycode:keyDataandcharacter, returningkErrInvalidAddressif null.keyboardTyperange (1..39), returningkErrInvalidKeyboardType.keyData->lengthandKEYBOARD_MAX_KEYCODES.ConvertCharacter(keycode, state, keyboardType).libSceConvertKeycodeto 4/4 (100.0%) completion.GuestConvertKeycodetest suite covering invalid pointers, out-of-bounds indices, invalid keyboard types, and character resolution.Tested
GuestConvertKeycodetest covers invalid address rejection, out-of-bounds index, keyboard layout validation, and successful UTF-16 character translation (both unshifted and shifted).python tools/check_conventions.py --base origin/mainpasses.python tools/progress.py --module libSceConvertKeycodereports 4/4 functions (100.0% complete).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)