Skip to content

test(sync): add minimal A5 TMOV col-major alignment repro#440

Open
TaoTao-real wants to merge 2 commits intohw-native-sys:mainfrom
TaoTao-real:codex/tmov-colmajor-align-repro-clean
Open

test(sync): add minimal A5 TMOV col-major alignment repro#440
TaoTao-real wants to merge 2 commits intohw-native-sys:mainfrom
TaoTao-real:codex/tmov-colmajor-align-repro-clean

Conversation

@TaoTao-real
Copy link
Copy Markdown
Contributor

Summary

  • Add a minimal A5 repro sample for TMOV on 16x1 f32 col_major tile in test/samples/Sync/test_tmov_col_major_16x1_align_a5.{py,pto}.
  • Add a row-major control sample in test/samples/Sync/test_tmov_row_major_1x16_control_a5.{py,pto}.
  • Extend test/samples/runop.sh:
    • Skip these two samples when --pto-arch is not a5.
    • Add guards to ensure generated C++ keeps TMOV and expected tile layout (ColMajor 16x1 / RowMajor 1x16).

Why

Provide a focused TMOV-only pair to isolate A5 runtime behavior in the suspected col-major alignment-sensitive path.

Validation

  • bash -n test/samples/runop.sh
  • ptoas --pto-arch=a5 --enable-insert-sync on both samples.
  • Verified C++ output contains:
    • repro: TMOV + Tile<...,16,1,BLayout::ColMajor,...>
    • control: TMOV + Tile<...,1,16,BLayout::RowMajor,...>

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new test samples and regression guards for TMOV alignment on the A5 architecture, specifically covering 16x1 column-major and 1x16 row-major tile configurations. The changes include new .pto and .py test files and updates to the runop.sh test runner to validate the emitted C++ code. A critical issue was identified in the test runner where an undefined variable target_arch_lc would cause the new tests to be incorrectly skipped; a suggestion was provided to use a consistent inline transformation for the architecture check.

fi
if [[ ( "$base" == "test_tmov_col_major_16x1_align_a5" || \
"$base" == "test_tmov_row_major_1x16_control_a5" ) && \
"${target_arch_lc}" != "a5" ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The variable target_arch_lc is not defined in this script. This will cause the condition to always evaluate to true (as an undefined variable expands to an empty string), resulting in these tests being skipped even when the target architecture is correctly set to a5. You should use the inline transformation consistent with the rest of the file to check the architecture.

Suggested change
"${target_arch_lc}" != "a5" ]]; then
"$(printf '%s' "$target_arch" | tr '[:upper:]' '[:lower:]')" != "a5" ]]; then

@TaoTao-real
Copy link
Copy Markdown
Contributor Author

/run a5 test_tmov_col_major_16x1_align_a5 test_tmov_row_major_1x16_control_a5 --pto-level=level3

@reedhecre
Copy link
Copy Markdown

A5 板测失败

  • 触发方式:manual
  • 源码提交:77007c944e9b
  • 结果汇总:OK 0 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260403_165306_manual_pr440.log
  • 手动指令:/run a5 test_tmov_col_major_16x1_align_a5 test_tmov_row_major_1x16_control_a5 --pto-level=level3
  • 触发人:TaoTao-real
  • 指定用例:test_tmov_col_major_16x1_align_a5,test_tmov_row_major_1x16_control_a5
  • PTOAS 参数:--pto-level=level3
  • 触发评论:test(sync): add minimal A5 TMOV col-major alignment repro #440 (comment)
  • 失败阶段:sample-build-and-test / exit=1

日志尾部

es/validation_runtime.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_reuse_sequential.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_peak_exact_capacity.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_peak_8_overlapping.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_no_reuse_overlap.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_nested_loops.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_loop_no_reuse_outer_live.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_loop_in_if.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_if_yield.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_if_in_loop.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_fragmentation_two_holes.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_fragmentation_hole_fit.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_for_iter_args_yield.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_bind_tile_alias_liveness.py [not in RUN_ONLY_CASES], test/samples/Xors/xors_golden.py [not in RUN_ONLY_CASES], test/samples/Xors/xors_compare.py [not in RUN_ONLY_CASES], test/samples/Xors/xors.py [not in RUN_ONLY_CASES], test/samples/Xor/xor_golden.py [not in RUN_ONLY_CASES], test/samples/Xor/xor_compare.py [not in RUN_ONLY_CASES], test/samples/Xor/xor.py [not in RUN_ONLY_CASES], ... (+413 more)

===== STAGE sample-build-and-test @ 2026-04-03 16:54:44 =====
bash test/samples/runop.sh --enablebc all
PTOAS_OUT_DIR=/tmp/ptoas-board-monitor-a5/runs/20260403_165306_manual_pr440/payload/test/samples
test/samples/runop.sh: line 274: target_arch_lc: unbound variable
===== END STAGE sample-build-and-test rc=1 @ 2026-04-03 16:54:46 =====

@TaoTao-real
Copy link
Copy Markdown
Contributor Author

/run a5 test_tmov_col_major_16x1_align_a5 test_tmov_row_major_1x16_control_a5 --pto-level=level3

@reedhecre
Copy link
Copy Markdown

A5 板测失败

  • 触发方式:manual
  • 源码提交:7d02cb803083
  • 结果汇总:OK 0 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260403_171805_manual_pr440.log
  • 手动指令:/run a5 test_tmov_col_major_16x1_align_a5 test_tmov_row_major_1x16_control_a5 --pto-level=level3
  • 触发人:TaoTao-real
  • 指定用例:test_tmov_col_major_16x1_align_a5,test_tmov_row_major_1x16_control_a5
  • PTOAS 参数:--pto-level=level3
  • 触发评论:test(sync): add minimal A5 TMOV col-major alignment repro #440 (comment)
  • 失败阶段:sample-build-and-test / exit=1

日志尾部

planmemory/plan_memory_loop_no_reuse_outer_live.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_loop_in_if.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_if_yield.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_if_in_loop.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_fragmentation_two_holes.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_fragmentation_hole_fit.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_for_iter_args_yield.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_bind_tile_alias_liveness.py [not in RUN_ONLY_CASES], test/samples/Xors/xors_golden.py [not in RUN_ONLY_CASES], test/samples/Xors/xors_compare.py [not in RUN_ONLY_CASES], test/samples/Xors/xors.py [not in RUN_ONLY_CASES], test/samples/Xor/xor_golden.py [not in RUN_ONLY_CASES], test/samples/Xor/xor_compare.py [not in RUN_ONLY_CASES], test/samples/Xor/xor.py [not in RUN_ONLY_CASES], ... (+413 more)

===== STAGE sample-build-and-test @ 2026-04-03 17:19:52 =====
bash test/samples/runop.sh --enablebc all
PTOAS_OUT_DIR=/tmp/ptoas-board-monitor-a5/runs/20260403_171805_manual_pr440/payload/test/samples
========== SUMMARY ==========
Sync(test_tmov_col_major_16x1_align_a5.pto) FAIL ptoas failed: test_tmov_col_major_16x1_align_a5.pto
Sync(test_tmov_col_major_16x1_align_a5.py) FAIL ptoas failed: test_tmov_col_major_16x1_align_a5-pto-ir.pto
Sync(test_tmov_row_major_1x16_control_a5.pto) FAIL ptoas failed: test_tmov_row_major_1x16_control_a5.pto
Sync(test_tmov_row_major_1x16_control_a5.py) FAIL ptoas failed: test_tmov_row_major_1x16_control_a5-pto-ir.pto
-----------------------------
OK=0  FAIL=4  SKIP=0
=============================
===== END STAGE sample-build-and-test rc=1 @ 2026-04-03 17:19:55 =====

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.

2 participants