port: record MSVC6 frontier through md5module
This commit is contained in:
+357
@@ -1,5 +1,360 @@
|
|||||||
# Port Status — CPython 3.11.16 to Windows 98 SE
|
# Port Status — CPython 3.11.16 to Windows 98 SE
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` `perm_comb_small` `fast_comb_limits2` C89 declaration-order slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 18:22 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read before changes. The nested `cpython/` checkout remains detached with all pre-existing local port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. MSVC6 remains external/local-only through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`; the verified compiler is `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86`.
|
||||||
|
|
||||||
|
The recorded frontier was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` was first. The first stable blocker was the C89 declaration-order defect at `mathmodule.c(3528)`–`(3532)`: `fast_comb_limits2` was declared after executable statements in `perm_comb_small()`. One focused coding-agent delegation was attempted; the Hermes delegation path failed because the runtime lacks the `anthropic` package. A direct Codex coding lane then added the focused regression assertion and ran the required red test, but stopped for confirmation because the array is `static const`; the minimal source edit was completed without broadening scope. No commits, pushes, or publication occurred.
|
||||||
|
|
||||||
|
This slice changed only:
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — moved the complete `static const fast_comb_limits2[]` initializer into `perm_comb_small()`'s opening declaration group and removed the later declaration. The array contents, lookup, and control flow are unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused structural assertion.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
|| Command | Result |
|
||||||
|
||---|---|
|
||||||
|
|| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(3528)` C2143 and `(3532)` C2065/C2109 for `fast_comb_limits2`; later diagnostics began at `(3605)`; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
|| Hermes focused delegation | failed before launch: `The 'anthropic' package is required for the Anthropic provider`; no child files were used. |
|
||||||
|
|| direct `codex exec -s workspace-write --skip-git-repo-check ...` | exit 0; added the focused assertion and ran it red with the expected `fast_comb_limits2` missing-declaration assertion; source remained unchanged when the lane stopped for confirmation. |
|
||||||
|
|| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`, including `perm_comb_small uses a C89 declaration-order-safe fast_comb_limits2 array`. |
|
||||||
|
|| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `mathmodule.c` compiled past this family. Next first stable blocker is `md5module.c(36)` C2632 for `long long`, followed by a designated initializer at `(498)` and declaration-order errors at `(527)`; summary `total=36 compiled=35 cached=0 skipped=0`. Existing warnings remain `mathmodule.c(1336)` C4113/C4133, `arraymodule.c(2247)` C4761, `audioop.c(1536)`/`(1609)` C4761, and `faulthandler.c(542)` C4047. |
|
||||||
|
|| full applicable regression command (`bash -n` plus public/core/PathCch/getpath/stdint/frontier suites) | exit 0; all suites passed and the focused frontier suite ended with `ALL TESTS PASSED`. |
|
||||||
|
|| `git -C cpython diff > compat/msvc600/cpython-3.11.16-vc6-headers.patch`; `cmp -s <(git -C cpython diff) compat/msvc600/cpython-3.11.16-vc6-headers.patch` | exit 0; regenerated patch matches the complete nested source diff byte-for-byte. `git -C cpython diff --check` also exited 0. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `perm_comb_small()` now compiles through its `fast_comb_limits2` C89 declaration-order family under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is `md5module.c(36)`, beginning with the distinct VC6 `long long` family. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` `_check_long_mult_overflow` C89 declaration-order slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 16:11 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changing anything, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. MSVC6 remains external/local-only through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`; the verified compiler is `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86`.
|
||||||
|
|
||||||
|
The recorded `math_isqrt()` frontier was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` remained first. The first stable blocker was the distinct C89 declaration-order family in `_check_long_mult_overflow()` at lines 3186–3190. One focused Codex coding-agent delegation ran in the existing checkout with the requested scope, preserved local changes, and did not commit, push, or publish. The child added the focused assertion and implementation; no independent review is claimed.
|
||||||
|
|
||||||
|
This slice changed only the following:
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — hoisted `diff`, `absdiff`, and `absprod` into `_check_long_mult_overflow()`'s opening declaration group and changed their original initializers to assignments at the same evaluation point. Overflow comparison and return behavior are unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused assertion for the opening declarations, assignment order, and unchanged return logic.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(3186)`–`(3190)` C2143/C2065 for the three post-statement `const double` declarations; later blockers at `(3525)` and `(3602)`; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| `codex exec -s workspace-write --skip-git-repo-check ...` | exit 0; focused implementation completed in the existing checkout; no commit, push, or publish. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after implementation | exit 0; `ALL TESTS PASSED`, including `_check_long_mult_overflow uses opening C89 declarations and original-point assignments`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after this slice | exit 2; `_check_long_mult_overflow()` compiled past this family. Next first stable blocker is the distinct declaration-order family at `mathmodule.c(3528)`–`(3532)` involving `fast_comb_limits2`; later diagnostics remain at `(3605)` onward. Summary `total=35 compiled=34 cached=0`. Existing warnings include `mathmodule.c(1336)` C4113/C4133, `arraymodule.c(2247)` C4761, `audioop.c(1536)`/`(1609)` C4761, and `faulthandler.c(542)` C4047. |
|
||||||
|
| `bash -n scripts/vc6-probe-pythoncore-frontier.sh scripts/vc6-probe-pythoncore-frontier.test.sh && bash scripts/vc6-probe.test.sh && bash scripts/vc6-probe-core.test.sh && bash scripts/vc6-probe-pathcch.test.sh && bash scripts/generate-getpath-frozen.test.sh && bash scripts/vc6-probe-stdint.test.sh && bash scripts/vc6-probe-pythoncore-frontier.test.sh` | exit 0; all applicable regression suites and shell syntax checks passed. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s <(git -C cpython diff) compat/msvc600/cpython-3.11.16-vc6-headers.patch` | exit 0; nested source diff is clean and the compatibility patch exactly matches the complete nested source diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `_check_long_mult_overflow()` now compiles through its C89 declaration-order family under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is `mathmodule.c(3528)`–`(3532)`, the `fast_comb_limits2` declaration-order family. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` `math_isqrt` C89 loop-counter slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 14:02 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changes, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified compiler remains MSVC6 `12.00.8804` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded `_blake2/blake2s_impl.c` sequence was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` remained first. The first stable blocker was the distinct C99 loop-counter declaration at `mathmodule.c(1945)`. One focused Codex coding-agent delegation ran in the existing checkout with the requested scope, preserved local changes, implemented only this slice, and did not commit, push, or publish. The child reported the required red-then-green focused TDD cycle; independent verification below confirms the green result. No independent review is claimed.
|
||||||
|
|
||||||
|
This slice changed only the following:
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added `int s` to `math_isqrt()`'s opening declaration group and changed `for (int s = ...)` to `for (s = ...)`; loop behavior is unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused assertion for the C89-safe `math_isqrt()` loop counter.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
|| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(1945)` C2143/C2065/C2059/C2143 for the C99 `for (int s = ...)`; later blockers at `(3185)`, `(3524)`, and `(3601)`; summary `total=35 compiled=34 cached=0`. |
|
||||||
|
| focused Codex delegation: `codex exec -s workspace-write --skip-git-repo-check ...` | exit 0; child performed the requested focused TDD implementation, with no commit/push/publish. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after implementation | exit 0; `ALL TESTS PASSED`, including `math_isqrt uses an opening C89 loop counter declaration`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after this slice | exit 2; `mathmodule.c` compiled past line 1945. Next first stable blocker is the distinct declaration-order family at `(3186)`–`(3190)` (`perm_comb_small()`); later blockers are `(3525)` and `(3602)`. Summary `total=35 compiled=34 cached=0`. Existing warnings remain `mathmodule.c(1336)`, `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n scripts/vc6-probe-pythoncore-frontier.sh scripts/vc6-probe-pythoncore-frontier.test.sh && bash scripts/vc6-probe.test.sh && bash scripts/vc6-probe-core.test.sh && bash scripts/vc6-probe-pathcch.test.sh && bash scripts/generate-getpath-frozen.test.sh && bash scripts/vc6-probe-stdint.test.sh && bash scripts/vc6-probe-pythoncore-frontier.test.sh` | exit 0; all applicable regression suites and shell syntax checks passed. |
|
||||||
|
| `git -C cpython diff > compat/msvc600/cpython-3.11.16-vc6-headers.patch && git -C cpython diff --check && cmp -s <(git -C cpython diff) compat/msvc600/cpython-3.11.16-vc6-headers.patch` | exit 0; patch exactly matches the complete nested source diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `math_isqrt()` now compiles through its C89 loop-counter family under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is `perm_comb_small()` at `mathmodule.c(3186)`–`(3190)`. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c guarded VC6 `expm1` fallback slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 11:54 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changes, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified compiler remains MSVC6 `12.00.8804` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded `_blake2/blake2s_impl.c` sequence was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` remained first. The first stable blocker was the distinct missing-VC6-CRT `expm1` family at line 1350. One focused coding-agent delegation was attempted as required but failed before launch because the runtime lacks the `anthropic` package; no child files were used and no independent review is claimed. This slice addressed only `expm1`; later declaration-order blockers remain untouched.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added an `_MSC_VER < 1300`-guarded `m_expm1()` fallback using a small-input quadratic approximation and `exp(x) - 1.0`; routed only `FUNC1(expm1, ...)` through it. Native compilers retain the CRT path through `#define m_expm1 expm1`.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the guarded fallback, small-input handling, native mapping, and routing.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(1350)` C2065 for unavailable `expm1`; later declaration-order blockers at `(1936)`, `(3176)`, `(3515)`, and `(3592)`; summary `total=35 compiled=34 cached=0`. |
|
||||||
|
| focused coding-agent delegation | failed before launch: `The 'anthropic' package is required for the Anthropic provider`; no child files were used and no independent review is claimed. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `VC6 m_expm1 fallback missing`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `mathmodule.c` compiled past `expm1`; next first stable blocker is the distinct declaration-order family at `(1945)`, with later families at `(3185)`, `(3524)`, and `(3601)`; summary `total=35 compiled=34 cached=0`. Existing warnings remain `mathmodule.c(1336)`, `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n scripts/vc6-probe-pythoncore-frontier.sh scripts/vc6-probe-pythoncore-frontier.test.sh && bash scripts/vc6-probe.test.sh && bash scripts/vc6-probe-core.test.sh && bash scripts/vc6-probe-pathcch.test.sh && bash scripts/generate-getpath-frozen.test.sh && bash scripts/vc6-probe-stdint.test.sh && bash scripts/vc6-probe-pythoncore-frontier.test.sh` | exit 0; all applicable regression suites and shell syntax checks passed. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s <(git -C cpython diff) compat/msvc600/cpython-3.11.16-vc6-headers.patch` | exit 0; patch exactly matches the complete nested source diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `expm1` now compiles through the guarded VC6 fallback under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the declaration-order family in `mathmodule.c` at line 1945. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` guarded VC6 `exp2` fallback slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 09:46 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changes, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified compiler remains MSVC6 `12.00.8804` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded `_blake2/blake2s_impl.c` sequence was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` remained first. The first stable blocker was the distinct missing-VC6-CRT `exp2` family at line 1336. One focused coding-agent delegation was attempted as required but failed before launch because the runtime lacks the `anthropic` package; no child files were used and no independent review is claimed. This slice addressed only `exp2`; `expm1` and later declaration-order blockers remain untouched.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added an `_MSC_VER < 1300`-guarded `m_exp2()` fallback using `exp(x * log(2.0))` with NaN preservation; routed only `FUNC1(exp2, ...)` through it. Native compilers retain the CRT path through `#define m_exp2 exp2`.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the guarded fallback, NaN handling, native mapping, and routing.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(1336)` C2065 for unavailable `exp2`; `expm1` followed at `(1341)`; summary `total=35 compiled=34 cached=0`. |
|
||||||
|
| focused coding-agent delegation | failed before launch: `The 'anthropic' package is required for the Anthropic provider`; no child files were used and no independent review is claimed. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `VC6 m_exp2 fallback missing`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `mathmodule.c` compiled past `exp2`; next first stable blocker is unavailable `expm1` at `(1350)`, followed by distinct declaration-order blockers at `(1936)`, `(3176)`, `(3515)`, and `(3592)`; summary `total=35 compiled=34 cached=0`. Existing warnings remain `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n scripts/vc6-probe-pythoncore-frontier.sh scripts/vc6-probe-pythoncore-frontier.test.sh && bash scripts/vc6-probe.test.sh && bash scripts/vc6-probe-core.test.sh && bash scripts/vc6-probe-pathcch.test.sh && bash scripts/generate-getpath-frozen.test.sh && bash scripts/vc6-probe-stdint.test.sh && bash scripts/vc6-probe-pythoncore-frontier.test.sh` | exit 0; all applicable regression suites and shell syntax checks passed. |
|
||||||
|
| `git -C cpython diff > compat/msvc600/cpython-3.11.16-vc6-headers.patch && git -C cpython diff --check && cmp -s <(git -C cpython diff) compat/msvc600/cpython-3.11.16-vc6-headers.patch` | exit 0; patch exactly matches the complete nested source diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `exp2` now compiles through the guarded VC6 fallback under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the missing-CRT `expm1` family at `mathmodule.c(1350)`. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` `math_ceil` C89 declaration-order slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 06:00 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changes, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified compiler remains MSVC6 `12.00.8804` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded `_blake2/blake2s_impl.c` sequence was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` remained first. The first stable blocker was the distinct C89 declaration-order defect in `math_ceil()` at line 1306. One focused Codex coding-agent delegation was run in workspace-write mode with the existing checkout; it preserved local changes, implemented only this slice, and did not commit, push, or publish. This slice addressed only `math_ceil()`; later `copysign`, `exp2`, `expm1`, and other mathmodule blockers remain untouched.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — hoisted `double x` into `math_ceil()`'s opening declaration group and changed its initializer to an assignment at the original evaluation point. Lookup, conversion, error handling, and return behavior are unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the opening declaration and original-point assignment.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(1306)` C2143/C2065 for `double x`; later distinct blockers at `(1317)`, `(1335)`, `(1340)`, `(1926)`, `(3166)`, `(3505)`, and `(3582)`; summary `total=35 compiled=34 cached=0`. |
|
||||||
|
| `codex exec -s workspace-write --skip-git-repo-check ...` | exit 0; focused TDD implementation completed; the child reported the expected red assertion before the source edit and green focused test afterward; no commit/push/publish. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after the slice | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after the slice | exit 2; `math_ceil()` compiled past this family. The next first stable blocker is unavailable VC6 CRT `exp2` at `mathmodule.c(1336)`; `expm1` follows at `(1341)`, with later distinct declaration-order blockers. Summary `total=35 compiled=34 cached=0`. |
|
||||||
|
| `bash -n scripts/vc6-probe-pythoncore-frontier.sh scripts/vc6-probe-pythoncore-frontier.test.sh && bash scripts/vc6-probe.test.sh && bash scripts/vc6-probe-core.test.sh && bash scripts/vc6-probe-pathcch.test.sh && bash scripts/generate-getpath-frozen.test.sh && bash scripts/vc6-probe-stdint.test.sh && bash scripts/vc6-probe-pythoncore-frontier.test.sh` | exit 0; all applicable regression suites and shell syntax checks passed. |
|
||||||
|
| `git -C cpython diff > compat/msvc600/cpython-3.11.16-vc6-headers.patch && git -C cpython diff --check && cmp -s <(git -C cpython diff) compat/msvc600/cpython-3.11.16-vc6-headers.patch` | exit 0; patch exactly matches the complete nested source diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `math_ceil()` now compiles through its C89 declaration-order family under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the missing-CRT `exp2` family at `mathmodule.c(1336)`. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` guarded VC6 `cbrt` fallback slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 05:29 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified MSVC6 banner remains `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`. `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read before changes.
|
||||||
|
|
||||||
|
The recorded `_blake2/blake2s_impl.c` sequence was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` was first. The first stable blocker was unavailable VC6 CRT `cbrt` at the prior line 1259. One focused coding-agent delegation was attempted for implementation but failed before launch because the runtime lacks the `anthropic` package; no child files were used and no independent review is claimed. This slice addressed only `cbrt`.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added an `_MSC_VER < 1300`-guarded `m_cbrt()` using `fabs`/`log`/`exp`, preserving NaN, signed zero, infinity, and sign handling; routed only `FUNC1(cbrt, ...)` through it. Native compilers retain the CRT path through `#define m_cbrt cbrt`.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the guarded fallback, special-value handling, native mapping, and routing.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable diagnostic `mathmodule.c(1259)` C2065 for unavailable `cbrt`, followed by distinct declaration-order and `exp2`/`expm1` blockers; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| focused coding-agent delegation | failed before launch: `The 'anthropic' package is required for the Anthropic provider`; no child files were used and no independent review is claimed. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `VC6 m_cbrt fallback missing`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `mathmodule.c` compiled past `cbrt`; next first stable blocker is `math_ceil()`'s post-statement `double x` declaration at `(1306)`, followed by distinct blockers at `(1317)`, `(1335)`, `(1340)`, `(1926)`, `(3166)`, `(3505)`, and `(3582)`; summary `total=35 compiled=34 cached=0 skipped=0`. Existing warnings remain `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n` plus public/core/PathCch/getpath/stdint/frontier regression suites | exit 0; all applicable suites passed and the focused frontier suite ended with `ALL TESTS PASSED`. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s` verification | exit 0; nested source diff is clean and the compatibility patch exactly matches the complete nested diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `cbrt` now compiles through the guarded VC6 fallback under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the distinct C89 declaration-order blocker in `math_ceil()` at `mathmodule.c(1306)`. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` guarded VC6 `atanh` fallback slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 03:21 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changing anything, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified MSVC6 banner remains `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded frontier was force-re-probed first and remained applicable: `_blake2/blake2s_impl.c` compiled, 34 sources compiled, and `mathmodule.c` remained first. The first stable blocker was the distinct missing-VC6-CRT math-function family: `atanh` at line 1233 before this slice, followed by `cbrt` at line 1236 and later declaration-order families. One focused read-only Codex coding-agent delegation inspected this exact frontier, made no edits, and recommended the isolated `m_atanh` fallback. No independent implementation review is claimed beyond that advisory inspection.
|
||||||
|
|
||||||
|
This run addressed only `atanh`:
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added an `_MSC_VER < 1300`-guarded `m_atanh()` using the stable logarithmic formulation with small-input preservation, signed-zero/NaN handling, and `EDOM` for `abs(x) >= 1`; routed only `FUNC1(atanh, ...)` through it. Native compilers retain the CRT `atanh` path through `#define m_atanh atanh`.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the guarded fallback, native mapping, domain handling, and routing.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable diagnostics `mathmodule.c(1233)` C2065 for `atanh`, then `cbrt` at `(1236)` and later distinct declaration-order blockers; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| focused read-only `codex exec -s read-only --skip-git-repo-check ...` | exit 0; recommended only the guarded `m_atanh` fallback and `FUNC1(atanh, m_atanh, 0, ...)`; no files changed, no broad build run. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `VC6 m_atanh fallback missing`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `mathmodule.c` compiled past `atanh`; next first stable blocker is unavailable `cbrt` at `(1259)`; later distinct blockers remain at `(1288)`, `(1908)`, `(3148)`, `(3487)`, and `(3564)`; summary `total=35 compiled=34 cached=0 skipped=0`. Existing warnings remain `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n` plus public/core/PathCch/getpath/stdint/frontier regression suites | exit 0; all applicable suites passed and the focused frontier suite ended with `ALL TESTS PASSED`. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s` verification | exit 0; nested source diff is clean and the compatibility patch exactly matches the complete nested diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `atanh` now compiles through the guarded VC6 fallback under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the remaining missing-CRT `cbrt` family at `mathmodule.c(1259)`; `exp2` and `expm1` remain distinct later blockers. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` guarded VC6 `asinh` fallback slice)
|
||||||
|
|
||||||
|
Date: 2026-09-19 01:12 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changing anything, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified MSVC6 banner remains `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded frontier was force-re-probed first and remained applicable: `_blake2/blake2s_impl.c` compiled, 34 sources compiled, and `mathmodule.c` remained first. The first stable blocker was the distinct missing-VC6-CRT math-function family, with `asinh` first at line 1212 before this slice. One focused coding-agent delegation was attempted for advisory inspection but failed before launch because the runtime lacks the `anthropic` package; no child files were used and no independent review is claimed. This run addressed only `asinh`; `atanh`, `cbrt`, `exp2`, `expm1`, and later declaration-order blockers remain untouched.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added an `_MSC_VER < 1300`-guarded `m_asinh()` implementation using sign symmetry, a large-argument overflow-safe branch, and the standard logarithmic form; routed only `FUNC1(asinh, ...)` through it. Native CRT paths and later math functions remain unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the guarded fallback and explicit `m_asinh` routing.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable diagnostics `mathmodule.c(1212)` C2065 for `asinh`, followed by `atanh` at `(1223)`, `cbrt` at `(1226)`, and later distinct families; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| focused coding-agent delegation | failed before launch: `The 'anthropic' package is required for the Anthropic provider`; no child files were used and no independent review is claimed. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `VC6 m_asinh fallback missing`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `mathmodule.c` compiled past `asinh`; next first stable blockers are unavailable `atanh` at `(1233)` and `cbrt` at `(1236)`; summary `total=35 compiled=34 cached=0 skipped=0`. Existing warnings remain `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n` plus public/core/PathCch/getpath/stdint/frontier regression suites | exit 0; all applicable suites passed and the focused frontier suite ended with `ALL TESTS PASSED`. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s` verification | exit 0; nested source diff is clean and the compatibility patch exactly matches the complete nested diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `asinh` now compiles through the guarded VC6 fallback under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the remaining missing-CRT math family beginning with `atanh`; `cbrt`, `exp2`, and `expm1` remain distinct later blockers. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` guarded VC6 `acosh` fallback slice)
|
||||||
|
|
||||||
|
Date: 2026-09-18 23:05 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changing anything, `PORT_STATUS.md`, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified MSVC6 banner remains `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86` through Wine using `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded frontier was force-re-probed first and remained applicable: `_blake2/blake2s_impl.c` compiled, 34 sources compiled, and `mathmodule.c` remained first. The first stable blocker was the distinct missing-VC6-CRT math-function family; `acosh` was the first error at line 1192 in the prior probe. One focused read-only Codex coding-agent delegation inspected this exact family, made no edits, and recommended a single guarded `m_acosh` fallback while leaving `asinh`, `atanh`, and `cbrt` for later slices. This run addressed only `acosh`.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added an `_MSC_VER < 1300`-guarded `m_acosh()` implementation with domain-error handling and overflow-safe large-argument branch; routed only `FUNC1(acosh, ...)` through it. The native CRT paths and the later missing functions remain untouched.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the guarded fallback and explicit `m_acosh` routing.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first blocker `mathmodule.c(1192)` C2065 for `acosh`, with later `asinh`, `atanh`, `cbrt`, `exp2`, `expm1`, and distinct declaration-order blockers; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| focused read-only `codex exec -s read-only --skip-git-repo-check ...` | exit 0; recommended only a guarded `m_acosh` fallback and `FUNC1(acosh, m_acosh, 0, ...)`; no files changed and no build run by the child. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `VC6 m_acosh fallback missing`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `mathmodule.c` compiled past `acosh`; next first stable blockers are `asinh` at line 1212, `atanh` at 1223, and `cbrt` at 1226; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| `bash -n` plus public/core/PathCch/getpath/stdint regression suites | exit 0; all applicable suites passed. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s` verification | exit 0; nested source diff is clean and the compatibility patch exactly matches the complete nested diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `acosh` now compiles through the guarded VC6 fallback under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the remaining missing-CRT math family beginning with `asinh`; `atanh`, `cbrt`, `exp2`, and `expm1` remain distinct later blockers. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` `math_lcm` C89 declaration-order slice)
|
||||||
|
|
||||||
|
Date: 2026-09-18 20:56 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. Before changing anything, this file, `README.md`, and `references/python-3-win9x-msvc6.md` were read. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. The verified MSVC6 compiler remains `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86` through Wine with `WINEPREFIX=/home/ubuntu/.wine-win9xport`.
|
||||||
|
|
||||||
|
The recorded frontier was force-re-probed first and remained applicable: 34 sources compiled and `mathmodule.c` remained first. The first stable blocker was `math_lcm()`'s post-statement borrowed `zero` declaration at line 946. One focused read-only Codex delegation inspected this exact function, made no edits, and recommended hoisting only `zero` while preserving the assignment point. This slice addressed only that C89 declaration-order family; `mathmodule.c`'s later distinct blockers remain untouched.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added `zero` to `math_lcm()`'s opening declaration group and changed its later declaration initializer to an assignment at the original point. Borrowed-reference ownership and loop behavior are unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the declaration, assignment, and borrowed-reference shape.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(946)` C2275/C2065 for `PyObject *zero`, followed by distinct blockers at `(1192)`, `(1242)`, `(1862)`, `(3102)`, `(3441)`, and `(3518)`; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| focused read-only `codex exec -s read-only --skip-git-repo-check ...` | exit 0; recommended moving `zero` into `PyObject *res, *x, *zero;` and assigning `zero = _PyLong_GetZero();`; no files changed and no build run by the child. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `math_lcm zero declaration missing from opening group`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `math_lcm()` compiled past this defect family. The next first stable blocker is `mathmodule.c(1192)` C2065 for unavailable `acosh`; summary `total=35 compiled=34 cached=0 skipped=0`. Existing warnings remain `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n` on frontier scripts plus public/core/PathCch/getpath/stdint regression suites | exit 0; all applicable suites passed. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s` verification | exit 0; nested source diff is clean and the compatibility patch exactly matches the complete nested diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `math_lcm()` now compiles past its borrowed-local C89 declaration-order family under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is the distinct `mathmodule.c(1192)` missing-`acosh` family. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`mathmodule.c` `math_gcd` C89 declaration-order slice)
|
||||||
|
|
||||||
|
Date: 2026-09-18 18:48 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. MSVC6 remains an external/local-only prerequisite through Wine with `WINEPREFIX=/home/ubuntu/.wine-win9xport`; the verified compiler is `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86`.
|
||||||
|
|
||||||
|
The recorded `_blake2/blake2s_impl.c` sequence was force-re-probed first, but the recorded `itertoolsmodule.c` frontier was no longer current: the actual first stable blocker was `mathmodule.c`. The first defect family was `math_gcd()`'s post-statement borrowed singleton declaration at line 871. One focused read-only Codex delegation inspected this exact function, made no edits, and recommended hoisting only `one` while preserving the assignment point. This slice addressed only that C89 declaration-order family.
|
||||||
|
|
||||||
|
- `cpython/Modules/mathmodule.c` — added `one` to `math_gcd()`'s opening declaration group and changed its later declaration initializer to an assignment at the original point. Borrowed-reference handling, early returns, and loop behavior are unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion for the declaration and assignment shape.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; 34 sources compiled; first stable blocker `mathmodule.c(871)` C2275/C2065 for `PyObject *one`, followed by distinct blockers at `(946)`, `(1192)`, `(1242)`, `(1862)`, `(3102)`, `(3441)`, and `(3518)`; summary `total=35 compiled=34 cached=0 skipped=0`. |
|
||||||
|
| focused read-only `codex exec -s read-only --skip-git-repo-check ...` | exit 0; recommended moving `one` into `PyObject *res, *x, *one;` and assigning `one = _PyLong_GetOne();`; no files changed and no build run by the child. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `math_gcd one declaration missing from opening group`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `math_gcd()` compiled past this defect family. The next first stable blocker is `mathmodule.c(946)` C2275/C2065 for `math_lcm()`'s distinct post-statement `zero` declaration; summary `total=35 compiled=34 cached=0 skipped=0`. Existing warnings remain `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. |
|
||||||
|
| `bash -n scripts/vc6-probe-pythoncore-frontier.sh scripts/vc6-probe-pythoncore-frontier.test.sh`, public/core/PathCch/getpath/stdint/frontier regression suites, `git -C cpython diff --check`, and patch `cmp -s` verification | exit 0; all applicable checks passed and the compatibility patch exactly matches the complete nested source diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `math_gcd()` now compiles past its C89 declaration-order family under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is `math_lcm()` at `mathmodule.c(946)`, beginning with its distinct borrowed `zero` declaration. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
|
## Latest revision (`gcmodule.c` duplicate declaration slice)
|
||||||
|
|
||||||
|
Date: 2026-09-18 16:40 UTC
|
||||||
|
|
||||||
|
Baseline remains CPython `v3.11.16` at commit `41388c9cb160d0886d5ca00d2e6c878260a8a4549`. The nested `cpython/` checkout remains detached with all pre-existing uncommitted port edits preserved. Nothing was reset, cleaned, stashed, discarded, committed, pushed, or published. MSVC6 remains an external/local-only prerequisite through Wine with `WINEPREFIX=/home/ubuntu/.wine-win9xport`; the verified compiler is `Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86`.
|
||||||
|
|
||||||
|
The recorded `_blake2/blake2s_impl.c` sequence was force-re-probed first and remained applicable: 30 sources compiled, including `faulthandler.c` and `gcmodule.c`. The first stable `gcmodule.c` diagnostic was a duplicate `PyGC_Head *gc, *next` declaration in `clear_unreachable_mask()` at lines 707 and 711. A focused coding-agent delegation was attempted for advisory inspection but failed before launch because the runtime lacks the `anthropic` package; no child files were used and no independent review is claimed. This slice addressed only that duplicate-declaration family.
|
||||||
|
|
||||||
|
- `cpython/Modules/gcmodule.c` — removed the second, redundant `PyGC_Head *gc, *next` declaration from `clear_unreachable_mask()`. The declaration group and control flow are otherwise unchanged.
|
||||||
|
- `scripts/vc6-probe-pythoncore-frontier.test.sh` — added the focused TDD assertion requiring exactly one declaration of the local pair.
|
||||||
|
- `compat/msvc600/cpython-3.11.16-vc6-headers.patch` — regenerated from the complete nested `git -C cpython diff`.
|
||||||
|
- `PORT_STATUS.md` — this report.
|
||||||
|
|
||||||
|
**Exact command results:**
|
||||||
|
|
||||||
|
| Command | Result |
|
||||||
|
|---|---|
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` before this slice | exit 2; summary `total=31 compiled=30 cached=0 skipped=0`; first stable diagnostics were `gcmodule.c(711)` C2143, followed by distinct diagnostics at `(1065)`, `(1180)`, and `(1293)`. |
|
||||||
|
| focused coding-agent delegation | failed before launch: `The 'anthropic' package is required for the Anthropic provider`; no child files were used and no independent review is claimed. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after adding the assertion, before source edit | exit 1 as required by TDD; `clear_unreachable_mask duplicate local declaration`. |
|
||||||
|
| `bash scripts/vc6-probe-pythoncore-frontier.test.sh` after source edit | exit 0; `ALL TESTS PASSED`. |
|
||||||
|
| `VC6_FRONTIER_FORCE=1 bash scripts/vc6-probe-pythoncore-frontier.sh` after source edit | exit 2; `gcmodule.c` compiled past the duplicate declaration. Existing warnings remain `arraymodule.c(2247)`, `audioop.c(1536)`, `(1609)`, and `faulthandler.c(542)`. The next first stable blocker is `cpython/Modules/itertoolsmodule.c`, with C2275/C2065 at line 883 and C2143/C2065/C2059 loop-declaration diagnostics at line 4878; summary `total=33 compiled=32 cached=0 skipped=0`. |
|
||||||
|
| full applicable regression suites and shell syntax checks | exit 0; public/core/PathCch/getpath/stdint/frontier suites all passed. |
|
||||||
|
| `git -C cpython diff --check`; patch regeneration plus `cmp -s <(git -C cpython diff) compat/msvc600/cpython-3.11.16-vc6-headers.patch` | exit 0; nested source diff is clean and the compatibility patch exactly matches the complete nested diff. |
|
||||||
|
|
||||||
|
**Current compile-frontier state:** `gcmodule.c` now compiles past its duplicate-local declaration family under MSVC6 (`cl.exe` 12.00.8804) through Wine. The next narrow frontier is `itertoolsmodule.c` at line 883, beginning with its post-statement `PyObject *dataobj` declaration; the later C99 loop family at line 4878 is distinct. This remains compiler-probe progress only: no linked `pythoncore.dll`/`python.exe`, no Wine execution of Python, and no real Windows 98 SE execution.
|
||||||
|
|
||||||
## Latest revision (`faulthandler.c` VC6 declaration/API compatibility slices)
|
## Latest revision (`faulthandler.c` VC6 declaration/API compatibility slices)
|
||||||
|
|
||||||
Date: 2026-09-18 16:03 UTC
|
Date: 2026-09-18 16:03 UTC
|
||||||
@@ -3766,3 +4121,5 @@ file is seen, so the true scope is not yet known. Recommended next steps:
|
|||||||
1. Continue with `Python/pylifecycle.c` by applying the same two mechanical
|
1. Continue with `Python/pylifecycle.c` by applying the same two mechanical
|
||||||
transforms already validated on `Modules/main.c` — hoist mid-block
|
transforms already validated on `Modules/main.c` — hoist mid-block
|
||||||
declarations (declaration-order slice) and replace compound-literal/
|
declarations (declaration-order slice) and replace compound-literal/
|
||||||
|
## Latest revision (`mathmodule.c` guarded VC6 `cbrt` fallback slice)
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -132,6 +132,111 @@ else
|
|||||||
bad "pymath.h provides a VC6 Py_NAN fallback without C99 NAN"
|
bad "pymath.h provides a VC6 Py_NAN fallback without C99 NAN"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Keep the current mathmodule.c VC6 frontier explicit: MSVC6 has no CRT
|
||||||
|
# atanh(), so the guarded fallback must preserve signed zero, NaN, and domain
|
||||||
|
# error behavior while native compilers retain the CRT path.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("#if defined(_MSC_VER) && _MSC_VER < 1300")
|
||||||
|
end = source.index("#else\n# define PY_MATH_ULONG_LONG", start)
|
||||||
|
block = source[start:end]
|
||||||
|
if "m_atanh(double x)" not in block:
|
||||||
|
raise SystemExit("VC6 m_atanh fallback missing")
|
||||||
|
if "if (Py_IS_NAN(x))" not in block:
|
||||||
|
raise SystemExit("m_atanh NaN handling missing")
|
||||||
|
if "if (a >= 1.0)" not in block or "errno = EDOM;" not in block:
|
||||||
|
raise SystemExit("m_atanh domain handling missing")
|
||||||
|
if "return x;" not in block:
|
||||||
|
raise SystemExit("m_atanh signed-zero/small-input preservation missing")
|
||||||
|
if "FUNC1(atanh, m_atanh, 0," not in source:
|
||||||
|
raise SystemExit("atanh is not routed through m_atanh")
|
||||||
|
if "# define m_atanh atanh" not in source:
|
||||||
|
raise SystemExit("native m_atanh mapping missing")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "mathmodule provides a guarded VC6 atanh fallback"
|
||||||
|
else
|
||||||
|
bad "mathmodule provides a guarded VC6 atanh fallback"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Keep the current mathmodule.c VC6 frontier explicit: MSVC6 has no CRT
|
||||||
|
# cbrt(), so the guarded fallback must preserve zero/NaN and native mapping.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("#if defined(_MSC_VER) && _MSC_VER < 1300")
|
||||||
|
end = source.index("#else\n# define PY_MATH_ULONG_LONG", start)
|
||||||
|
block = source[start:end]
|
||||||
|
if "m_cbrt(double x)" not in block:
|
||||||
|
raise SystemExit("VC6 m_cbrt fallback missing")
|
||||||
|
if "if (Py_IS_NAN(x))" not in block or "if (x == 0.0)" not in block:
|
||||||
|
raise SystemExit("m_cbrt special-value handling missing")
|
||||||
|
if "FUNC1(cbrt, m_cbrt, 0," not in source:
|
||||||
|
raise SystemExit("cbrt is not routed through m_cbrt")
|
||||||
|
if "# define m_cbrt cbrt" not in source:
|
||||||
|
raise SystemExit("native m_cbrt mapping missing")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "mathmodule provides a guarded VC6 cbrt fallback"
|
||||||
|
else
|
||||||
|
bad "mathmodule provides a guarded VC6 cbrt fallback"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Keep the current mathmodule.c VC6 frontier explicit: MSVC6 has no CRT
|
||||||
|
# exp2(), so the guarded fallback must preserve NaN handling and native mapping.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("#if defined(_MSC_VER) && _MSC_VER < 1300")
|
||||||
|
end = source.index("#else\n# define PY_MATH_ULONG_LONG", start)
|
||||||
|
block = source[start:end]
|
||||||
|
if "m_exp2(double x)" not in block:
|
||||||
|
raise SystemExit("VC6 m_exp2 fallback missing")
|
||||||
|
if "if (Py_IS_NAN(x))" not in block:
|
||||||
|
raise SystemExit("m_exp2 NaN handling missing")
|
||||||
|
if "FUNC1(exp2, m_exp2, 1," not in source:
|
||||||
|
raise SystemExit("exp2 is not routed through m_exp2")
|
||||||
|
if "# define m_exp2 exp2" not in source:
|
||||||
|
raise SystemExit("native m_exp2 mapping missing")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "mathmodule provides a guarded VC6 exp2 fallback"
|
||||||
|
else
|
||||||
|
bad "mathmodule provides a guarded VC6 exp2 fallback"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Keep the current mathmodule.c VC6 frontier explicit: MSVC6 has no CRT
|
||||||
|
# expm1(), so the guarded fallback must preserve small inputs and native mapping.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("#if defined(_MSC_VER) && _MSC_VER < 1300")
|
||||||
|
end = source.index("#else\n# define PY_MATH_ULONG_LONG", start)
|
||||||
|
block = source[start:end]
|
||||||
|
if "m_expm1(double x)" not in block:
|
||||||
|
raise SystemExit("VC6 m_expm1 fallback missing")
|
||||||
|
if "if (fabs(x) < 1e-5)" not in block:
|
||||||
|
raise SystemExit("m_expm1 small-input handling missing")
|
||||||
|
if "FUNC1(expm1, m_expm1, 1," not in source:
|
||||||
|
raise SystemExit("expm1 is not routed through m_expm1")
|
||||||
|
if "# define m_expm1 expm1" not in source:
|
||||||
|
raise SystemExit("native m_expm1 mapping missing")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "mathmodule provides a guarded VC6 expm1 fallback"
|
||||||
|
else
|
||||||
|
bad "mathmodule provides a guarded VC6 expm1 fallback"
|
||||||
|
fi
|
||||||
|
|
||||||
# Keep the first _pickle.c VC6/C89 slice explicit: batch_list_exact() must
|
# Keep the first _pickle.c VC6/C89 slice explicit: batch_list_exact() must
|
||||||
# declare its shared error local before executable statements.
|
# declare its shared error local before executable statements.
|
||||||
if python3 - "$REPO_ROOT/cpython/Modules/_pickle.c" <<'PY'
|
if python3 - "$REPO_ROOT/cpython/Modules/_pickle.c" <<'PY'
|
||||||
@@ -2468,6 +2573,233 @@ else
|
|||||||
bad "_datetimemodule _datetime_exec uses C89-compatible locals"
|
bad "_datetimemodule _datetime_exec uses C89-compatible locals"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# The active mathmodule.c VC6 frontier must provide a local asinh fallback for
|
||||||
|
# MSVC6 while leaving newer CRTs on the native implementation.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("#if defined(_MSC_VER) && _MSC_VER < 1300")
|
||||||
|
end = source.index("#endif\n\n/*[clinic input]", start)
|
||||||
|
block = source[start:end]
|
||||||
|
if "static double\nm_asinh(double x)" not in block:
|
||||||
|
raise SystemExit("VC6 m_asinh fallback missing")
|
||||||
|
if "FUNC1(asinh, asinh, 0," in source:
|
||||||
|
raise SystemExit("mathmodule still routes asinh through the unavailable CRT symbol")
|
||||||
|
if "FUNC1(asinh, m_asinh, 0," not in source:
|
||||||
|
raise SystemExit("mathmodule does not route asinh through the fallback")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "mathmodule provides a guarded VC6 asinh fallback"
|
||||||
|
else
|
||||||
|
bad "mathmodule provides a guarded VC6 asinh fallback"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The active mathmodule.c VC6 frontier must provide a local acosh fallback for
|
||||||
|
# MSVC6 while leaving newer CRTs on the native implementation.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("#if defined(_MSC_VER) && _MSC_VER < 1300")
|
||||||
|
end = source.index("#endif\n\n/*[clinic input]", start)
|
||||||
|
block = source[start:end]
|
||||||
|
if "static double\nm_acosh(double x)" not in block:
|
||||||
|
raise SystemExit("VC6 m_acosh fallback missing")
|
||||||
|
if "FUNC1(acosh, acosh, 0," in source:
|
||||||
|
raise SystemExit("mathmodule still routes acosh through the unavailable CRT symbol")
|
||||||
|
if "FUNC1(acosh, m_acosh, 0," not in source:
|
||||||
|
raise SystemExit("mathmodule does not route acosh through the fallback")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "mathmodule provides a guarded VC6 acosh fallback"
|
||||||
|
else
|
||||||
|
bad "mathmodule provides a guarded VC6 acosh fallback"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The active mathmodule.c VC6/C89 frontier must hoist math_gcd()'s borrowed
|
||||||
|
# singleton local before executable statements while preserving its assignment point.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("math_gcd(PyObject *module")
|
||||||
|
end = source.index("\n}\n\nPyDoc_STRVAR(math_gcd_doc", start) + 2
|
||||||
|
function = source[start:end]
|
||||||
|
opening = function[:function.index(" if (nargs == 0)")]
|
||||||
|
if " PyObject *res, *x, *one;\n" not in opening:
|
||||||
|
raise SystemExit("math_gcd one declaration missing from opening group")
|
||||||
|
if " PyObject *one = _PyLong_GetOne();" in function:
|
||||||
|
raise SystemExit("math_gcd retains mixed one declaration")
|
||||||
|
if function.count(" one = _PyLong_GetOne(); // borrowed ref\n") != 1:
|
||||||
|
raise SystemExit("math_gcd one assignment missing")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "math_gcd uses C89 declaration-order-safe borrowed singleton local"
|
||||||
|
else
|
||||||
|
bad "math_gcd uses C89 declaration-order-safe borrowed singleton local"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The active mathmodule.c VC6/C89 frontier must hoist math_lcm()'s borrowed
|
||||||
|
# zero local before executable statements while preserving its assignment point.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("math_lcm(PyObject *module")
|
||||||
|
end = source.index("\n}\n\n\nPyDoc_STRVAR(math_lcm_doc", start) + 2
|
||||||
|
function = source[start:end]
|
||||||
|
opening = function[:function.index(" if (nargs == 0)")]
|
||||||
|
if " PyObject *res, *x, *zero;\n" not in opening:
|
||||||
|
raise SystemExit("math_lcm zero declaration missing from opening group")
|
||||||
|
if " PyObject *zero = _PyLong_GetZero();" in function:
|
||||||
|
raise SystemExit("math_lcm retains mixed zero declaration")
|
||||||
|
if function.count(" zero = _PyLong_GetZero(); // borrowed ref\n") != 1:
|
||||||
|
raise SystemExit("math_lcm zero assignment missing or duplicated")
|
||||||
|
if " Py_INCREF(zero);" in function or " Py_DECREF(zero);" in function:
|
||||||
|
raise SystemExit("math_lcm borrowed zero reference ownership changed")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "math_lcm uses C89 declaration-order-safe borrowed zero local"
|
||||||
|
else
|
||||||
|
bad "math_lcm uses C89 declaration-order-safe borrowed zero local"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The active gcmodule.c VC6/C89 frontier must not redeclare clear_unreachable_mask()
|
||||||
|
# locals after the initial declaration group.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/gcmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("clear_unreachable_mask(PyGC_Head *unreachable)")
|
||||||
|
end = source.index("\n}\n\n/* A traversal callback", start) + 2
|
||||||
|
function = source[start:end]
|
||||||
|
if function.count(" PyGC_Head *gc, *next;\n") != 1:
|
||||||
|
raise SystemExit("clear_unreachable_mask duplicate local declaration")
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "gcmodule clear_unreachable_mask uses one C89 declaration group"
|
||||||
|
else
|
||||||
|
bad "gcmodule clear_unreachable_mask uses one C89 declaration group"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# math_ceil() must declare x before statements and convert at the original point.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("math_ceil(PyObject *module, PyObject *number)")
|
||||||
|
end = source.index("\n}\n", start) + 2
|
||||||
|
function = source[start:end]
|
||||||
|
opening = function[:function.index(" if (!PyFloat_CheckExact(number))")]
|
||||||
|
assert (
|
||||||
|
" double x;\n" in opening
|
||||||
|
and "double x =" not in function
|
||||||
|
and function.count(" x = PyFloat_AsDouble(number);\n") == 1
|
||||||
|
and " if (PyErr_Occurred())\n return NULL;\n }\n"
|
||||||
|
" x = PyFloat_AsDouble(number);\n"
|
||||||
|
" if (x == -1.0 && PyErr_Occurred())" in function
|
||||||
|
), "math_ceil needs an opening x declaration and original-point assignment"
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "math_ceil uses an opening C89 declaration and original-point assignment"
|
||||||
|
else
|
||||||
|
bad "math_ceil uses an opening C89 declaration and original-point assignment"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# math_isqrt() must declare its slow-path loop counter in the opening group.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("math_isqrt(PyObject *module, PyObject *n)")
|
||||||
|
end = source.index("\n}\n", start) + 2
|
||||||
|
function = source[start:end]
|
||||||
|
opening = function[:function.index(" n = _PyNumber_Index(n);")]
|
||||||
|
assert (
|
||||||
|
" int s;\n" in opening
|
||||||
|
and "for (int s" not in function
|
||||||
|
and function.count(" for (s = c_bit_length - 6; s >= 0; --s) {\n") == 1
|
||||||
|
), "math_isqrt needs an opening int s declaration and assignment-only loop initializer"
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "math_isqrt uses an opening C89 loop counter declaration"
|
||||||
|
else
|
||||||
|
bad "math_isqrt uses an opening C89 loop counter declaration"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# _check_long_mult_overflow() must declare temporaries before its early return
|
||||||
|
# while evaluating their expressions only at the original point after it.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("_check_long_mult_overflow(long a, long b)")
|
||||||
|
end = source.index("\n}\n", start) + 2
|
||||||
|
function = source[start:end]
|
||||||
|
opening, statements = function.split(" if (doubled_longprod == doubleprod)", 1)
|
||||||
|
for name in ("diff", "absdiff", "absprod"):
|
||||||
|
assert f" double {name};\n" in opening, (
|
||||||
|
f"_check_long_mult_overflow needs an opening {name} declaration"
|
||||||
|
)
|
||||||
|
assert f"double {name}" not in statements, (
|
||||||
|
f"_check_long_mult_overflow retains a mixed {name} declaration"
|
||||||
|
)
|
||||||
|
assert statements == """ {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff = doubled_longprod - doubleprod;
|
||||||
|
absdiff = diff >= 0.0 ? diff : -diff;
|
||||||
|
absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
|
||||||
|
|
||||||
|
if (32.0 * absdiff <= absprod) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}""", "_check_long_mult_overflow must preserve evaluation order and return logic"
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "_check_long_mult_overflow uses opening C89 declarations and original-point assignments"
|
||||||
|
else
|
||||||
|
bad "_check_long_mult_overflow uses opening C89 declarations and original-point assignments"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# fast_comb_limits2 must be declared before perm_comb_small() executes statements.
|
||||||
|
if python3 - "$REPO_ROOT/cpython/Modules/mathmodule.c" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
source = Path(sys.argv[1]).read_text()
|
||||||
|
start = source.index("perm_comb_small(PY_MATH_ULONG_LONG n,")
|
||||||
|
end = source.index("\n}\n", start) + 2
|
||||||
|
function = source[start:end]
|
||||||
|
opening, statements = function.split(" if (k == 0) {", 1)
|
||||||
|
declaration = """ static const PY_MATH_ULONG_LONG fast_comb_limits2[] = {
|
||||||
|
0, PY_MATH_ULLONG_MAX, (PY_MATH_ULONG_LONG)4294967296I64, 3329022, 102570, 13467, 3612, 1449, // 0-7
|
||||||
|
746, 453, 308, 227, 178, 147, // 8-13
|
||||||
|
};"""
|
||||||
|
assert (
|
||||||
|
declaration in opening
|
||||||
|
and function.count("static const PY_MATH_ULONG_LONG fast_comb_limits2[]") == 1
|
||||||
|
and " if (k < Py_ARRAY_LENGTH(fast_comb_limits2) && n <= fast_comb_limits2[k]) {" in statements
|
||||||
|
), "perm_comb_small opening fast_comb_limits2 declaration missing or changed"
|
||||||
|
PY
|
||||||
|
then
|
||||||
|
pass "perm_comb_small uses a C89 declaration-order-safe fast_comb_limits2 array"
|
||||||
|
else
|
||||||
|
bad "perm_comb_small uses a C89 declaration-order-safe fast_comb_limits2 array"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$fail" -ne 0 ]; then
|
if [ "$fail" -ne 0 ]; then
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user