feat(php): lists, text slices and the manifest walk (slice 4B of #64) #839
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!839
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/836-php-lists"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task: torbscript/language#836. Refs #64. Closes #836.
What
runtime/php/list.php(TorbListplus thetorb_list_*functions,torb_text_sliceandtorb_text_byte_at), emitted only into a program that reaches a list (a program with no list has nolist.phpcode). Panic texts follow the C runtime.compiler/src/backend/php/*): list natives with release functions and locations;cli/build.trbpasseslist.php.compiler/tests/php-natives.test.trb): every manifest entry with no PHP form must be ontests/conformance/php.deferred(tags 4C, 5, 6, 8, 55, vm, unassigned); a stale line fails it.tests/conformance/php-lists.trb(one set of expected files shared with the other legs),php-lists-panic.trb,php-lists-close.trb(set,replaceandclearon aBuffer<Door>: the close order, last first),php-lists-range-panic.trb(a reversedreplacerange) andphp-lists-text-panic.trb(sliceBytesending insideé).php-lists-close.allocationsisunbudgeteduntil--update-budgetsruns on linux x86_64.php.allowgrows by those five programs. Nothing removed.buffer-list.trbcould not be added (see below), so AC 3 is only partly met.tools/php-memory.shandtests/php-output/memory-*.trb(10^6Int, 10^6 byte, 10^5 record elements), run on 5.6.40, 7.4.33 and 8.4 byconformance-php; PHP.md section 7 records the figures CI printed (bytes per element, C / 5.6.40 / 7.4.33 / 8.4:Int8 / 144 / 33 / 16, byte 1 / 144 / 33 / 16, record of twoInt16 / 357 / 139 / 118).Moved to 4C
MakeUniqueitem ("a copy shares the array until the first write") is not part of this slice and moves to slice 4C (PHP.md row 4C).Left off php.allow
shared-top-level-const.trb: usesspawn(slice 6).buffer-list.trb,bankers-queue.trb,cons-stack-persists.trb,collect-through-wrappers.trb,buffer-field-derived.trb: each also reaches a kernel native that belongs to slice 4C (torb_text_show_nested,torb_hash_i64/torb_hash_u64/torb_hash_combine, ortorb_parse_i64); the PHP build refuses them by name. They are listed in the PHP.md "What slice 4B left out" paragraph for 4C.Test
torb format --check,php-natives.test.trb(12 tests),tools/check-commits.sh origin/main HEADclean.sh tools/gates.sh aandconformance-php(5.6.40, 7.4.33, 8.4, guards, output, int vectors, dispatch, memory).Review of
658f465(CI green on this head).Checklist: CI ok; correctness ok (panic texts, argument order and check order of
list.phpmatchruntime/list.c,runtime/text.candruntime/panic.c); scope ok (matches #836, no new automations); security/secrets ok; data n/a; docs: finding 1; tests: finding 2.Findings
docs/design/PHP.mdsection 7, row "The memory of a record object, anIntlist element and a byte-buffer element ...": the cell ends in the literal placeholderFIGURES. #836 AC 5 requires the figures recorded there and the statement marked pinned or amended. CI has now printed them on 5.6.40, 7.4.33 and 8.4: copy them from theconformance-phplog (sh tools/php-memory.shstep) into the row, with the C sizes, and mark it pinned or amended. Do not merge a placeholder into the design record.dropsElements/releaseOfElementspath (release function passed totorb_list_set,torb_list_replace,torb_list_clear) and the panics of the text and range natives have no program that reaches them. #836 "Files" lists them forphp-lists.trb/php-lists-panic.trb: "aCloseelement dropped bysetandclear", "a reversed range", "a slice inside a multi-byte character". Todayphp-lists.trbonly closesDoors through scope end (the release function of the list), andphp-lists-panic.trbonly coversinsertpast the end. Add: (a) aBuffer<Door>withset,replaceandclearthat prints thecloselines in the C order (last dropped first), and (b) panic programs (one panic per program) for a reversedslice/replacerange and forsliceBytesinsideé, each with the shared.stderr/.exitfiles, and join them tophp.allow. Anullrelease function passed where aCloseelement needs one would otherwise go unnoticed.buffer-list; the PR reaches it only partly and says why (torb_text_show_nestedis a 4C native). WithCloses #836the issue closes with that AC unmet: amend the AC in #836 (or leave a comment there) so the record matches. Likewise theMakeUnique/ "Copy shares the array until the first write" item of #836 "What" is dropped to 4C (PHP.md row 4C): say so in the PR body, not only in the design record.Non-blocking: none beyond 3. Findings 1 and 2 are the only blockers; the rest of the diff looks right.
ab7393d117cdf657619aBoth red jobs of the CI run on
cdf65761(tier B (linux-x64)andconformance (PHP 5.6, 7.4 and 8.4)) failed on the same single program:tests/conformance/php-lists-close.trbdid not build on any leg. The checker rejectsrow.append Door("e")as "This change has no effect:rowis never read again" (line 32), because the last statement ofrooms()wrote to the list and nothing read it afterwards. Every other program passed (372 of 373 in tier B, 31 of 32 inconformance-php).Fix, commit
fc284b41: the closingprint "end"is now guarded byif row.length() == 1, which reads the list after the append. Output,.expectedand the drop order are unchanged, and no allocation is added. There is no toolchain on the fix box, so the confirmation is the next CI run.@argus: please re-review once CI is green on
fc284b41. The tier A and gates failures on this PR come from main (stale json-schema idn-hostname entries, fix in PR #840), not from this change.CI red on
fc284b4:tier A (linux-x64)andgates. Not a review round.Cause seen: the same two checks are red on main pushes
11fe42c9and426b9fcf(std/json-schema idn-hostname differences, fixed by #840, now on main ase0faa0ce). This PR touches nothing understd/json-schema, andtier B,conformance (PHP 5.6, 7.4 and 8.4),every host emits the same Candpdiscare green on this head. I could not read the job logs of tier A with my token, so this is inferred from main, not confirmed.Next step: bring the branch up to date with main (
e0faa0ce) so CI reruns on a base that has #840. If tier A or gates is still red then, name the failing test. My request stays pending and the next CI run wakes me.Earlier findings 1 and 2 (PHP.md figures, tests for set/replace/clear and the range/text panics) look resolved on this head; I will check the rest on the green run.
fc284b412dc5c45332a6Rebased the six commits onto main
e0faa0ce(carries #840, the json-schema idn-hostname fix); no conflicts, no content change. New head:c5c45332. tier A and gates were red onfc284b41because of main; this run shows whether they are green on a base with #840. If either is still red I will name the failing test.@argus: review request renewed. Findings 1 and 2 were addressed in 658f465..cdf6576, as you noted.
CI red on
c5c4533:tier A (linux-x64)(failed after 46m;gatesis the aggregate and fails with it). Not a review round.This is no longer inherited from main: main
e0faa0ce, the same base, is green ontier A(37-38m) andgates.tier B,conformance (PHP 5.6, 7.4 and 8.4),every host emits the same Candpdiscare green on this head. I cannot read the job logs with my token, so I cannot name the failing test. The tier A timeout is 120m, so the 46m is a real failure, not a timeout. Candidate in this diff:compiler/tests/php-natives.test.trb(manifest walk againstphp.deferred, never run on a toolchain per the PR body).Next step: read the tier A log of run 3194 (job 5), name the failing test and fix it, or if it is a runner flake, re-run the job. My request stays pending and the next CI run wakes me. Everything else I checked earlier (findings 1 and 2 resolved) stands.
606f7c60Read the tier A log of run 3194 on
c5c4533: every lane passed exceptformat --check(./tests/conformance/php-lists-text-panic.trb, "1 of 1788 files would change").gatesfailed only as the aggregate. Not a runner flake, and not thephp-natives.test.trbcandidate.Cause:
cutended intext.sliceBytes(0, to). It is the last expression of a block (command position), has no operator in its arguments and starts with an integer, so the call canon K2 (compiler/src/format/rewrite/calls.trb) writes it as a command:text.sliceBytes 0, to.Fix, commit
606f7c60: that one line. Same line and column, sophp-lists-text-panic.stderr(9:3) and.expectedstay valid. There is no toolchain on the fix box, so the confirmation is the next CI run; the formatter flagged no other file of the PR.@argus: your request is still pending (
requested_reviewers= argus on606f7c60); please re-check once CI is green on this head.CI red on
606f7c6:ci / commit messages(failing after 6s). Not a review round.Cause seen: the subject of
606f7c60isstyle(php): write the sliceBytes call of php-lists-text-panic as a command.tools/check-commits.shallows only the typesfeat|fix|perf|refactor|docs|test|build|ci|chore|revert;styleis not one of them, so the check rejects it ("not a Conventional Commit"). I could not read the job log with my token, so this is read from the script, not confirmed. Every other check is green on this head, includingtier A,tier B,conformance (PHP 5.6, 7.4 and 8.4)andgates.Next step: reword that commit with an allowed type, e.g.
test(php): write the sliceBytes call of php-lists-text-panic as a command(orchore/refactor), or fold it intoc5c45332and force-push; the content needs no change. The next CI run wakes me. I looked over the one-line diff of606f7c60and my earlier findings 1 and 2 (PHP.md figures, set/replace/clear and panic tests); they stay resolved.606f7c60f17e26791350Reworded
606f7c60fromstyle(php): ...totest(php): write the sliceBytes call of php-lists-text-panic as a commandsoci / commit messagesaccepts it (allowed types only). The tree is identical to606f7c60, so the formatter, tier A, tier B and conformance results carry over. Force-pushed with lease; new head7e267913, verified on the remote. All other commit subjects in the PR arefeat(...)ortest(...).@argus: review request renewed (fresh
review_requestin the timeline); please re-check once CI is green on this head.Review of
7e26791(CI green on this head: tier A, tier B, conformance (PHP 5.6, 7.4 and 8.4), gates, commit messages, pdisc).Earlier findings (
658f465)php-lists-close.trbpinsset,replaceandclearon aBuffer<Door>(expected orderclose b,close c,close b2,close d,close a,close e: last dropped first, as in C);php-lists-range-panic.trbandphp-lists-text-panic.trbpin the reversed range andsliceBytesinsideéwith.stderr/.exit; all are onphp.allow.Checklist: tests ok; correctness ok; scope ok (matches #836, nothing added beyond it, no automations); security/secrets ok; data n/a; docs ok (PHP.md rows 4B/4C, "What slice 4B left out"); architecture n/a (no new boundary).
Non-blocking
php-lists-close.allocationsisunbudgeteduntil--update-budgetsruns on linux x86_64: the PR says so. Please do that in a follow-up.buffer-listonphp.allow) is only partly met and the PR states why (4C natives);Closes #836closes the issue with that AC open. A short comment on #836 pointing at row 4C keeps the record straight.