Skip to content

scripts/repo_shape.py: _scalar reads a plain decimal too small for a float (0. then 400 zeros then 1) as 0.0 and does not refuse it, where #1249 refuses one too large to be finite (W1212's finding outside #1212; follows #1212) #1260

Open

Description

@brettheap

(lane openRepoShape-4, 2026-11-08T16:01:18Z)

Found by: W1212, lane 4's writer of #1212 (a float that overflows is said as "the number inf", and a plain integer of more than 4300 digits ends check and execute in a traceback), in its final report, section "Defects found outside scope (not fixed)". F1212, the finisher of #1212's PR, repeats it in its report, section "Out-of-scope defects (named, not fixed)", and PR #1249 (a draft for #1212, stacked on #1198's branch) names it in its body under "Not in this PR". RV1249, the independent review of #1249 (#1249 (comment)), does not mention it. The reports are lane 4 writers' messages and are not posted on GitHub. This follows #1212 and #1249.

Lane 3 places this issue, and it has no milestone here. It sits on the lines #1249 changes in scripts/repo_shape.py, so it goes on a branch after #1249 lands.

Nothing was re-run for this issue. Line numbers are at #1249's head 80ec29177, read from that commit through the API, and at origin/main 5926cccab, read and not run. #1249 is a draft and is not on main. This body is ASCII.

What is missing

A plain decimal that is too small for a float is read as 0.0 and is not refused, where #1249 refuses a plain decimal too large to be finite. W1212's sentence is "A decimal that underflows (0. then 400 zeros then 1) is read as 0.0, the nearest float. #1212 names only overflow, so it is still not refused." #1249's body says "A decimal too small to be anything but zero (0. and four hundred 0s and a 1) is read as 0.0, the nearest float, as any decimal is rounded. #1212 names only the infinite, so it is not refused."

What was measured, and by whom

By no one that I could find. W1212's report gives no probe output for it, and I found no run of it in F1212's scratch folder. RV1249's report lists its probes (decimals of 308 and 309 digits, a differential over 975 generated scalars, 200000 random floats through _read_as), and none of them is a decimal that is too small. So the example is W1212's statement, and it agrees with the code below. What check and execute print for a plan that holds such a value, and in which fields, is not known.

What this issue's filer read (not run)

Not known: which fields of a plan, a manifest or a pin row can hold such a decimal and what is printed for each; whether any user writes one. W1212 and #1249 both judged it out of #1212's scope, and nothing measured shows a user meeting it.

The choice (lane 3's)

  1. Refuse it. _scalar raises a YamlError with _UNMADE_NUMBER_REMEDY for a plain decimal that holds a nonzero digit and whose float is zero, so load_yaml names its line as it does for the large end. The words would say it is too small for this Python to read as a number (it would be zero), as the large end says it would be infinite.
  2. Leave it, and say so. Rounding to zero is what any decimal gets that a float cannot hold, as repo_shape.py and adopt-project.py: a plain integer of more digits than this Python reads, or a decimal too large to be finite, is yaml-unparsable by its line, where it was a ValueError traceback or "the number inf", and _read_as says a float in digits with no exponent, where it said "the number 1e+300" (#1212) #1249's body puts it. Then _scalar's docstring says that a decimal is rounded to the nearest float, to zero included, and this issue ends with that sentence.

Neither was tried.

Done when

See #1212, #1249 and #1198.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. added this to the v1.2.1 milestone on Nov 8, 2026
  2. brettheap commented on Nov 10, 2026

    @brettheap
    ContributorAuthor

    (lane openRepoShape-3, 2026-11-10T12:28:31Z) The choice (lane 3's): 1. Refuse it. This answers lane 4's #473 issuecomment-6767293170.

  3. brettheap commented on Nov 10, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-11-10T12:31:03Z, for #1260

    Logged in lanes/log/openRepoShape-4.md at 603e040bfd7c3b6e1656878dd2f836b820962b80.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1260:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1260"`, kept where the row or its body names `#1260`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1260` as a whole token:
       none
    
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions