Skip to content

[amd-staging-rocgdb-16] ROCgdb cherry picks from origin/amd-staging (2026-08-14) - #280

Draft
lumachad wants to merge 16 commits into
amd-staging-rocgdb-16from
users/lumachad/amd-staging-rocgdb-16/cherry-picks-20260814
Draft

[amd-staging-rocgdb-16] ROCgdb cherry picks from origin/amd-staging (2026-08-14)#280
lumachad wants to merge 16 commits into
amd-staging-rocgdb-16from
users/lumachad/amd-staging-rocgdb-16/cherry-picks-20260814

Conversation

@lumachad

Copy link
Copy Markdown
Collaborator

Commits:

4eb72aa github: drop ROCM_PATH when --try-rocm-path is not passed
2759845 gdb, testsuite: fix 'no such variable' error in gdb.rocm/hip-catch-errors.exp
0f469e1 github: improve TheRock dependency update workflow
c846714 github: test_rocgdb.py: add --fraction/-f parallel job scaling
bd5bec7 gdb: extend maint print address-spaces to show all dbgapi available info
b77c0ec Revert "github: improve TheRock dependency update workflow"
e73e8d5 github: improve TheRock dependency update workflow
15166d2 [ci] Fetch build and CPU test runner dynamically from therock-ci-config
3b25daf gdb.rocm/omp-target-basic: handle firstprivate compiler type bug gracefully
787f638 gdb, amdgpu: add a CHANGELOG note about '#' operator in Fortran
1ce65b7 gdb.rocm/alu-exceptions: prevent ROCr core dumps on exceptions
cdf61a4 github: remove push triggers, run CI only on PRs
f9349a6 github: tighten CI workflow security settings
aed4c48 bfd,binutils: add support for gfx1103
c3bc421 gdb/testsuite/hip: pass --offload-arch flags in hip.exp
a423d9b doc: add TESTING.md documenting testing strategy

spatrang and others added 16 commits August 14, 2026 04:50
Add a top-level TESTING.md summarizing ROCgdb's testing strategy: the
selftest (unit test) framework, the DejaGnu functional testsuite
(including the GPU tests), performance tests, when tests run in CI, and
how to add new tests.

The document stays concise and high-level, defers to upstream GDB testing
docs (gdb/testsuite/README, the TestingGDB wiki) as the source of truth,
and points to README-ROCM.md / gdb/README for build and dependency details
rather than duplicating them.

(cherry picked from commit f127056)
The hip board was not passing any --offload-arch flags to the compiler,
so HIP defaulted to the compiler's built-in target, which may not match
the actual GPU on the machine.

Fix this by calling hcc_amdgpu_targets in hip.exp's gdb_compile override
to add the correct --offload-arch flags, matching what gdb.exp already
does for regular HIP tests.

find_amdgpu_devices compiles a host-only probe program to obtain the
target list.  It passes hip_no_offload_arch to signal that no
--offload-arch is needed for that compile.  Without a corresponding
guard in our override, calling hcc_amdgpu_targets there would recurse
back into find_amdgpu_devices before its result is cached, causing an
infinite loop.  Fix this by skipping our override entirely when
hip_no_offload_arch is present.

Also fix an existing bug where lreplace was called with index -1 when
"c++" was not in the options list, silently removing the last element.

(cherry picked from commit 586cad8)
Add ELF header definition for gfx1103.  The canonical source is:

https://llvm.org/docs/AMDGPUUsage.html#amdgpu-ef-amdgpu-mach-table
(cherry picked from commit 30336c7)
Remove secrets: inherit from all reusable workflow calls since no named
secrets are explicitly referenced; AWS authentication is handled via OIDC.

Remove the /runner/config bind-mount and AWS_SHARED_CREDENTIALS_FILE env
var from the build container, as boto3 will use credentials set by the
OIDC configure-aws-credentials step instead.

Guard the Post Build Upload step against fork PRs to prevent S3 uploads
from untrusted forks.

Addresses ROCM-26823.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit f5601c3)
TheRock CI and pre-commit were running on both push and pull_request
events. Since every change goes through a PR, the push runs on
amd-staging are redundant and waste CI resources.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 0e4734a)
Starting with commit c586808 ("gdb: recognize address space
operator '#' in fortran"), there is support for the '#' operator in
Fortran programs.  Note this in the CHANGELOG file.

(cherry picked from commit c518939)
…efully

Issue an XFAIL only when the bug presents itself, avoiding an XPASS.

(cherry picked from commit 8d57cb8)
Previously the build job hardcoded azure-linux-scale-rocm (Azure) and
the CPU test job hardcoded aws-linux-scale-rocm-prod (AWS). Both
labels are now selected dynamically from ROCm/therock-ci-config's
runner-config.json (build_runners.linux.default, highest-weight entry)
so CI tracks fleet changes without manual updates.

The setup job in therock-ci.yml checks out therock-ci-config and reads
the runner label via ci_config_api.py, passing it as build_runs_on to
therock-ci-linux.yml (new workflow_call input). therock-test-packages.yml
applies the same logic in configure_test_matrix for the CPU test runner.
Both steps fall back to aws-linux-scale-rocm-prod if therock-ci-config
is unavailable (e.g., in forks).

The runner-selection logic is extracted into .github/scripts/select_runner.py
to avoid duplication between the two workflows.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit cc4697e)
Move THEROCK_COMMIT_REF and the build container digest out of
therock-ci-linux.yml and into .github/configs.json, a plain data file
documented in .github/configs.md. A resolve job reads and validates the
pins and exposes them as outputs; the build job references those outputs
for container.image and THEROCK_COMMIT_REF. This lets the automated
update workflow push changes with only contents: write on the
GITHUB_TOKEN.

The update script is reworked accordingly:

- Fetch the TheRock branch HEAD and committer timestamp from the GitHub
  REST API (retried on transient failures) instead of git ls-remote and
  date.today(). Fetch the build image creation timestamp from the OCI
  config blob instead of date.today(). Both timestamps are stored in
  full ISO 8601 format and gated per pin so an unchanged value keeps
  its original timestamp. Timestamp fetches are skipped in dry-run mode.
- Validate all API response fields with descriptive errors; guard
  required config keys before any git side-effects.
- PR title is "Automated TheRock dependency update (<date>)"; body
  lists each bumped pin with its short ref and date.
- Print both tracked values on every run with clear update / unchanged
  labels; name what would change in dry-run mode.

Add a comprehensive unit test suite covering all public functions,
including retry logic, error paths, timestamp gating, and the
run_update state machine.

(cherry picked from commit 1dfad84)
This reverts commit 1dfad84.

(cherry picked from commit 6b70fad)
The maint print address-spaces command previously printed only a flat
list of address-space names.  Rewrite address_spaces_dump to query
dbgapi for five properties per address space and emit them as a
structured ui_out table: name, DWARF number, address size in bits, null
address, and access class.

A new helper, address_space_access_to_string, maps the
amd_dbgapi_address_space_access_t enum to a human-readable string (all,
program-constant, dispatch-constant).  The command help text and the
maint print address-spaces section in gdb.texinfo are updated to
document the new columns.

A new test, gdb.rocm/maint-print-address-spaces.exp, runs the command,
and checks that a header row and at least one data row are printed
without error.

(cherry picked from commit 92775a3)
Add -f/--fraction F as an alternative to -j/--jobs for controlling
parallelism.  The two options are mutually exclusive.  When --fraction
is given, the job count is resolved as max(1, int(cpu_count * F)),
allowing callers to request a hardware-proportional limit without
knowing the exact core count of the target machine.

Both options still require --parallel.

(cherry picked from commit 33f3678)
Move the inline python3 -c validation out of the resolve step into a
standalone .github/scripts/config.py script. The script validates each
requested field against an allow-list of known fields and their expected
formats (40-char hex SHA for therock_commit_ref, ghcr.io sha256 digest
for build_image), and writes field=value pairs to $GITHUB_OUTPUT.

Also guard the validate() call against non-string field values (e.g. null
or a number in configs.json) so the script emits the friendly error message
rather than an uncaught TypeError traceback.

(cherry picked from commit e761ce9)
…rors.exp

Running gdb.rocm/hip-catch-errors.exp in an environment where the
__hipOnError symbol is not defined gives

  ERROR: tcl error sourcing <path-to>/gdb/testsuite/gdb.rocm/hip-catch-errors.exp.
  ERROR: can't read "res": no such variable
      while executing
  "return $res"
      ("uplevel" body line 27)
        invoked from within
  "uplevel 1 $body"
      invoked from within
  "with_test_prefix preparation_test {
      with_rocm_gpu_lock {
          clean_restart ${::testfile}.dbg
          if {![runto_main]} {
            return false
          }
          gdb_test_mul..."

Fix this by defining "res" at an earlier point.

The problem here is in fact deeper.  The code body that is used in
preparation_test has return statements.  One would expect the return
statements to actually return from preparation_test early and not even
reach `return $res`, but that's not happening because of how
with_rocm_gpu_lock and with_lock are defined and use Tcl's uplevel.
Fixing them will be more involved and should be addressed separately.

(cherry picked from commit 3a93be6)
A system-wide ROCM_PATH can redirect LLVM tool lookups away from the
artifacts tree configured by setup_environment, causing hard-to-diagnose
test failures.  Strip it from the subprocess environment whenever the
caller has not explicitly opted in via --try-rocm-path.

(cherry picked from commit 128d02e)
@github-actions github-actions Bot changed the title ROCgdb cherry picks from origin/amd-staging (2026-08-14) [amd-staging-rocgdb-16] ROCgdb cherry picks from origin/amd-staging (2026-08-14) Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants