The Windows CPU cpp-wrapper repro in #162366 still had a test expectation that assumed generated C++ int64 array literals always use the L suffix. MSVC-generated code uses LL for these literals, and the test already had the same platform split elsewhere through target_assert_size_stride_str. That made CPUReproTests.test_require_stride_order_non_owning fail on Windows even when the generated allocation and stride-order behavior was correct.
Factor the cpp-wrapper int-array formatting into cpp_int_array_str() and reuse it in both the existing assert-size-stride helper and the repro test. This keeps the expectation tied to the platform-specific generated C++ spelling instead of hard-coding Linux formatting in the Windows test path.
The attached convolution_backward C-shim failures from the issue are already addressed on current main by 1b421fae114 [inductor] Fix MSVC const pointer emission in cpp wrapper temporary arrays (#179846), so this change is limited to the remaining Windows-sensitive FileCheck expectation.
Fixes #162366
Generated by my agent
Test Plan:
- TORCHINDUCTOR_CPP_WRAPPER=1 python - <<'PY'
import runpy
import sys
sys.modules['torchvision'] = None
sys.path.insert(0, 'test/inductor')
sys.argv = ['test/inductor/test_cpu_repro.py', 'CPUReproTests.test_require_stride_order_non_owning']
runpy.run_path('test/inductor/test_cpu_repro.py', run_name='main')
PY - python - <<'PY'
import sys
sys.modules['torchvision'] = None
sys.path.insert(0, 'test/inductor')
import test_torchinductor
orig = sys.platform
try:
sys.platform = 'win32'
assert test_torchinductor.cpp_int_array_str([2, 3, 4, 4]) == '{2LL, 3LL, 4LL, 4LL}'
sys.platform = 'linux'
assert test_torchinductor.cpp_int_array_str([2, 3, 4, 4]) == '{2L, 3L, 4L, 4L}'
finally:
sys.platform = orig
print('cpp_int_array_str platform formatting OK')
PY - TORCHINDUCTOR_CPP_WRAPPER=1 python - <<'PY'
import runpy
import sys
sys.modules['torchvision'] = None
sys.path.insert(0, 'test/inductor')
sys.argv = ['test/inductor/test_torchinductor.py', 'CpuTests.test_conv_backward_cpu']
runpy.run_path('test/inductor/test_torchinductor.py', run_name='main')
PY - TORCHINDUCTOR_CPP_WRAPPER=1 python - <<'PY'
import runpy
import sys
sys.modules['torchvision'] = None
sys.path.insert(0, 'test/inductor')
sys.argv = ['test/inductor/test_torchinductor.py', 'CpuTests.test_conv2d_backward_channels_last_cpu']
runpy.run_path('test/inductor/test_torchinductor.py', run_name='main')
PY - python - <<'PY'
import runpy
import sys
sys.modules['torchvision'] = None
sys.path.insert(0, 'test/inductor')
sys.argv = ['test/inductor/test_cpu_repro.py', 'CPUReproTests.test_require_stride_order_non_owning']
runpy.run_path('test/inductor/test_cpu_repro.py', run_name='main')
PY - lintrunner -a
Pull Request resolved: #185145
Approved by: https://github.com/desertfire
SOCIAL SHARE CARD GENERATOR