Skip to content

[TEST] tests/test_docs_contract_refs.py red on main again: base.py grew 114 lines (#4894/#4906/#4912/#4930), four doc citations (awq-scale-folding, calibration-replay, fp8-scale-semantics) out of window #4967

Closed

Description

@Qubitium

Found on main @ 3867c82, RTX 4090 (CPU-only test).

What is wrong

tests/test_docs_contract_refs.py (#4791; last re-anchored by #4877 for #4864) is red again on main. Four doc citations into gptqmodel/models/base.py are now 114 lines off, and the test allows a window of 8:

$ pytest -q tests/test_docs_contract_refs.py
E AssertionError: docs/awq-scale-folding.md cites `_select_prev_op` at gptqmodel/models/base.py:5489, but it is defined at [5603]
E AssertionError: docs/calibration-replay.md cites `capture_layer_type_replay_kwargs` at gptqmodel/models/base.py:4022, but it is defined at [4136]
E AssertionError: docs/calibration-replay.md cites `_build_layer_type_position_embeddings` at gptqmodel/models/base.py:4005, but it is defined at [4119]
E AssertionError: docs/fp8-scale-semantics.md cites `_decoder_fp8_scale_semantics` at gptqmodel/models/base.py:4752, but it is defined at [4866]
4 failed, 16 passed

Drift of def _select_prev_op across the merges since round 16, all without doc updates: 5490 (#4852) -> 5503 (#4894, already outside the window) -> 5530 (#4906) -> 5558 (#4912) -> 5603 (#4930).

Suggested fix

Re-anchor the four citations (docs/awq-scale-folding.md, docs/calibration-replay.md x2, docs/fp8-scale-semantics.md). Because every base.py change keeps breaking these line-number citations, consider citing file::symbol instead and letting the test resolve the line. Otherwise, run this test in the pre-merge CPU suite.

Test that should have caught it

This test catches it, but it was not run on #4894/#4906/#4912/#4930 before they merged.

Severity

Low (test-only), but main is red.

🤖 Generated with Claude Code

Activity

  1. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-root-4967 is working on this issue now.

  2. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Fixed by #4971 (squash-merged, 5a131c673). The guard now accepts a symbol-anchored citation (gptqmodel/models/base.py::_select_prev_op), and the four drifting docs use it, so a base.py growth no longer breaks them; the line-number form stays for files that are not growing. The test also runs pre-merge now (first file of the AWQ CPU unit suite, with docs/** added to that workflow's path filter) — AWQ CPU (unit) passed on the PR, so it executed there. tests/test_docs_contract_refs.py: 4 failed / 16 passed → 20 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions