[PR #142] gpu_peek: fix FEAT_READOUT_1 nine-field decode #141

Open
opened 2026-11-07 17:30:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JustAResearcher/gpu-unlock-ada/pull/142
Author: @ducduong97hn
Created: 11/7/2026
Status: 🔄 Open

Base: main ← Head: fix/feat-readout-1-decode


📝 Commits (1)

  • bd84eef gpu_peek: fix FEAT_READOUT_1 nine-field decode (#136)

📊 Changes

1 file changed (+9 additions, -1 deletions)

View changed files

📝 diagnostics/peek/gpu_peek.c (+9 -1)

📄 Description

peek_cluster() decodes FEAT_READOUT_1 as (value >> (3 * field)) & 7 for field 0..8, treating the nine fields as contiguous 3-bit groups. They are not: the fields sit at bit offsets 0, 3, 7, 10, 13, 16, 19, 22, 28, with gaps at bit 6 and bits 27:25. The shift slips one bit from the third field onward.

Checked by hand against the issue's example:

value = 0x00c36180
old (buggy):     0 0 6 0 6 6 0 6 0
new (shift table): 0 0 3 0 3 3 0 3 0

Both match what the issue reports (the old decode produces four out-of-range 6s for a field that is only ever 0-5; the new one matches the expected correct decode). This also confirms the issue's point that the "values 6 are out of range" follow-up on #12 was the decoder, not the card.

Fix is exactly the shift table the issue suggested:

static const unsigned char feat_readout_1_shift[9] = { 0, 3, 7, 10, 13, 16, 19, 22, 28 };

Didn't add the suggested userspace unit test: gpu_peek.c has no #ifdef __KERNEL__ userspace branch the way vbios_610.c does, so there's no existing harness to hang a test on, and building one just for this one function felt like more new infrastructure than the fix warrants. Happy to add one if you'd rather have it than not.

Fixes #136


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JustAResearcher/gpu-unlock-ada/pull/142 **Author:** [@ducduong97hn](https://github.com/ducduong97hn) **Created:** 11/7/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/feat-readout-1-decode` --- ### 📝 Commits (1) - [`bd84eef`](https://github.com/JustAResearcher/gpu-unlock-ada/commit/bd84eefc98038672d7430f98e31d6adcd6de228c) gpu_peek: fix FEAT_READOUT_1 nine-field decode (#136) ### 📊 Changes **1 file changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `diagnostics/peek/gpu_peek.c` (+9 -1) </details> ### 📄 Description `peek_cluster()` decodes `FEAT_READOUT_1` as `(value >> (3 * field)) & 7` for `field` 0..8, treating the nine fields as contiguous 3-bit groups. They are not: the fields sit at bit offsets `0, 3, 7, 10, 13, 16, 19, 22, 28`, with gaps at bit 6 and bits 27:25. The shift slips one bit from the third field onward. Checked by hand against the issue's example: ``` value = 0x00c36180 old (buggy): 0 0 6 0 6 6 0 6 0 new (shift table): 0 0 3 0 3 3 0 3 0 ``` Both match what the issue reports (the old decode produces four out-of-range 6s for a field that is only ever 0-5; the new one matches the expected correct decode). This also confirms the issue's point that the "values 6 are out of range" follow-up on #12 was the decoder, not the card. Fix is exactly the shift table the issue suggested: ```c static const unsigned char feat_readout_1_shift[9] = { 0, 3, 7, 10, 13, 16, 19, 22, 28 }; ``` Didn't add the suggested userspace unit test: `gpu_peek.c` has no `#ifdef __KERNEL__` userspace branch the way `vbios_610.c` does, so there's no existing harness to hang a test on, and building one just for this one function felt like more new infrastructure than the fix warrants. Happy to add one if you'd rather have it than not. Fixes #136 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JustAResearcher/gpu-unlock-ada#141
No description provided.