Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions swe-paddle/tasks/PaddlePaddle__Paddle-77749/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ The task adds `paddle.nn.utils.rnn.pad_sequence` and `paddle.nn.utils.rnn.unpad_
## Test Classification

- **F2P:** all 21 cases in the new `test/legacy_test/test_rnn_utils.py` file. They cannot import the new module on the exact base and pass after the solution.
- **P2P:** the exact gold test patch adds no independent P2P cases because the entire target file is new. Existing Paddle utility and Tensor behavior remains an external regression expectation.
- **P2P:** `test/legacy_test/test_rnn_cell_api.py::TestRnnUtil::test_case`, an untouched RNN utility regression guard for `paddle.utils.map_structure` / `paddle.utils.assert_same_structure`. The gold diff does not modify that file, and the node passes on both the exact base and gold revisions.

## Artifact Map

- `proposal.md`: approved source proposal; preserved unchanged.
- `instruction.md`: self-contained observable requirements for the public APIs.
- `solution/code.patch`: exact base-to-gold diff for the two production files.
- `tests/test.patch`: exact base-to-gold diff adding the unittest file.
- `tests/test.sh`: strict direct-Python unittest wrapper.
- `tests/test.sh`: wrapper that runs the existing RNN utility P2P node before the new F2P API test file.
- `environment/README.md`: revisions, runtime assumptions, patch order, and verification guidance.

## Verification Summary

- Both patches are exported from the exact base-to-gold Git diff with the requested production/test boundary.
- Packaging checks cover patch whitespace, shell syntax, isolated test-first application order, byte-for-byte gold equivalence, and Python syntax.
- Runtime execution is performed with isolated exact-source overlays when the exact historical native build is unavailable; the runtime commit and results are recorded in `environment/README.md`.
- The selected `TestRnnUtil` P2P node is byte-for-byte unchanged between the base and gold revisions and passed repeated runs on both isolated overlays; the base target failed at the `paddle.nn.utils.rnn` import and the gold target ran all 21 cases with `OK`. Runtime details are recorded in `environment/README.md`.
20 changes: 15 additions & 5 deletions swe-paddle/tasks/PaddlePaddle__Paddle-77749/environment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ git apply /path/to/PaddlePaddle__Paddle-77749/solution/code.patch
PYTHON_BIN=python bash /path/to/PaddlePaddle__Paddle-77749/tests/test.sh
```

The first run is expected to fail while importing the absent `paddle.nn.utils.rnn` module. After applying the solution and refreshing the runtime's Python package, all 21 target cases should pass.
The first run must show the existing P2P RNN utility node passing, followed by the expected failure while the target file imports the absent `paddle.nn.utils.rnn` module. After applying the solution and refreshing the runtime's Python package, both the P2P node and all 21 target cases should pass.

The wrapper deliberately executes the legacy unittest file directly:
The wrapper runs the P2P guard and then the F2P target:

```bash
# P2P guard: existing RNN utility behavior
(
cd test/legacy_test
"${PYTHON_BIN:-python}" -m pytest -q \
test_rnn_cell_api.py::TestRnnUtil::test_case
)

# F2P target: newly added pad_sequence / unpad_sequence tests
"${PYTHON_BIN:-python}" test/legacy_test/test_rnn_utils.py
```

Expand All @@ -41,11 +49,13 @@ The wrapper deliberately executes the legacy unittest file directly:
- The available loadable runtime is 363 commits newer than the exact base. It supplies best-effort native support but is not an exact historical runtime.
- A pre-solution overlay that leaves the newer runtime's RNN utility module in place invalidates F2P verification.
- These APIs rely on Tensor creation, concatenation, stacking, transposition, and slicing behavior. A substantially different runtime can introduce unrelated failures.
- The exact test patch contains only new F2P coverage, so broad P2P confidence requires existing Paddle regression suites beyond this target wrapper.
- The exact test patch contains only new F2P coverage, so the wrapper adds the existing RNN utility node `test/legacy_test/test_rnn_cell_api.py::TestRnnUtil::test_case` as an explicit P2P guard. Broader P2P confidence still relies on the rest of Paddle's regression suites.
- Do not patch, reset, clean, or otherwise alter the dirty `/workspace/Paddle` checkout. Use an isolated snapshot or worktree.

## Local Verification Record

Package validation passed for artifact presence, unchanged `proposal.md`, shell syntax, patch whitespace, exact file boundaries, test-first then solution application, byte-for-byte equality with the gold revision, and Python syntax compilation. Neither the wrapper nor the environment commands invokes an alternate test runner.
Package validation passed for artifact presence, unchanged `proposal.md`, shell syntax, patch whitespace, exact file boundaries, test-first then solution application, byte-for-byte equality with the gold revision, and Python syntax compilation. The wrapper invokes `pytest` only for the pre-existing P2P node; the new target file is still executed directly.

Runtime validation used isolated overlays backed by the loadable runtime at `ae907b878e91dbabf3582da99f8b05a46b588fc2`, 363 commits after the exact base. The base overlay replaced the utility exports with the exact base file and removed the newer runtime's RNN utility module; the test-only run then failed during import with `ModuleNotFoundError`, as expected. The gold overlay used both exact gold production files, and the complete direct-Python wrapper ran 21 tests with `OK`. Because the exact test patch is an entirely new file, this target run provides F2P coverage only and does not claim an independent P2P result. The dirty `/workspace/Paddle` checkout was not modified.
Runtime validation used isolated overlays backed by the loadable runtime at `ae907b878e91dbabf3582da99f8b05a46b588fc2`, 363 commits after the exact base. The base overlay replaced the utility exports with the exact base file and removed the newer runtime's RNN utility module; the target run then failed during import with `ModuleNotFoundError`, as expected. The gold overlay used both exact gold production files, and the complete direct-Python target ran 21 tests with `OK`. The dirty `/workspace/Paddle` checkout was not modified.

After adding the P2P guard, an additional stability check used isolated exact base/gold overlays with an installed Paddle `3.5.0.dev20260814` CPU runtime on macOS. `test/legacy_test/test_rnn_cell_api.py::TestRnnUtil::test_case` passed 5/5 on the base overlay and 5/5 on the gold overlay; the base target still failed with `ModuleNotFoundError`, and the gold target ran 21 tests with `OK`.
10 changes: 10 additions & 0 deletions swe-paddle/tasks/PaddlePaddle__Paddle-77749/tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@ set -euo pipefail

PYTHON_BIN="${PYTHON_BIN:-python}"

# P2P (pass-to-pass): existing RNN utility regression guard. The gold patch
# does not modify test/legacy_test/test_rnn_cell_api.py, so this node must pass
# both before and after the solution is applied.
(
cd test/legacy_test
"${PYTHON_BIN}" -m pytest -q \
test_rnn_cell_api.py::TestRnnUtil::test_case
)

# F2P (fail-to-pass): all cases in the newly added API test file.
"${PYTHON_BIN}" test/legacy_test/test_rnn_utils.py