Repository navigation
[AUTOMATED] fix(cli): decompile-project takes the callee-first order, so a struct_N means one record - #693
Merged
Conversation
`kuna decompile-project` kept its own address-order schedule while `kuna decompile-all` decompiles callees first (option protoorder, on by default). Both keep a structsynth ledger, and which `struct_N` a measured layout becomes depends on the order the program is visited in, so the two surfaces named different records the same thing: on du -O2, 29 of 30 synthesized names disagreed between the exported header and `decompile-all --json`. The export now takes the same order under the same conditions, so a name means one record on both surfaces. `--option protoorder off` restores the old schedule; `--stream` and `decompile-graph` keep theirs and still say so. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…program surfaces Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…rection Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…he bundle Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…oorder off The serial export a --jobs run replays is the one without the callee-first order, the same contract decompile-all's pool tests already name. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… that do take the order Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
…er surfaces Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
The embedded `decompile-project` usage still promised `--jobs N` artifacts were identical to `--jobs 1`; with the callee-first export schedule that holds against `--jobs 1 --option protoorder off`, which is what `decompile-all`'s block and docs/cli.md already say. Measured on the i386_pie_nl fixture: `--jobs 4 --jobs-chunk 1` matches the option-off serial export byte for byte on .c/.h/.asm/README and differs from the default serial export on the first three. Also: the `--stream` contract section scoped stream-vs-non-stream differences to layout, but a streamed export keeps the address-order schedule, so its prototypes are the option-off ones (18 header lines differ from the default on that fixture, same set as the option-off arm); and the browser `project` export calls the eager batch directly, so docs/web-integration.md no longer claims the README `Path` row is its only difference from the CLI. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… surfaces `jobs.rs` named `decompile-all` alone as the surface whose callee-first order a worker pool cannot reproduce; `decompile-project` takes the same order now. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
… bundle Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
force-pushed
the
fix/layoutvote
branch
from
September 20, 2026 16:37
7ea4113 to
3ac48e4
Compare
mahaloz
added a commit
that referenced
this pull request
Sep 20, 2026
…e limit, the re-derived fixture swap Adds three sections to the feature analysis: the utmp/utmpx rows reaching a caller's own local on who/logoutd/runlevel (they ship on a pool count, not a sweep delta, and this is what they buy); the table's sizes being glibc x86-64 with nothing scaling them by word size, and what that is confined to; and the export fixture swap re-derived under #693's callee-first schedule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
…e limit, the re-derived fixture swap Adds three sections to the feature analysis: the utmp/utmpx rows reaching a caller's own local on who/logoutd/runlevel (they ship on a pool count, not a sweep delta, and this is what they buy); the table's sizes being glibc x86-64 with nothing scaling them by word size, and what that is confined to; and the export fixture swap re-derived under #693's callee-first schedule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
…e limit, the re-derived fixture swap Adds three sections to the feature analysis: the utmp/utmpx rows reaching a caller's own local on who/logoutd/runlevel (they ship on a pool count, not a sweep delta, and this is what they buy); the table's sizes being glibc x86-64 with nothing scaling them by word size, and what that is confined to; and the export fixture swap re-derived under #693's callee-first schedule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
…e limit, the re-derived fixture swap Adds three sections to the feature analysis: the utmp/utmpx rows reaching a caller's own local on who/logoutd/runlevel (they ship on a pool count, not a sweep delta, and this is what they buy); the table's sizes being glibc x86-64 with nothing scaling them by word size, and what that is confined to; and the export fixture swap re-derived under #693's callee-first schedule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
…e limit, the re-derived fixture swap Adds three sections to the feature analysis: the utmp/utmpx rows reaching a caller's own local on who/logoutd/runlevel (they ship on a pool count, not a sweep delta, and this is what they buy); the table's sizes being glibc x86-64 with nothing scaling them by word size, and what that is confined to; and the export fixture swap re-derived under #693's callee-first schedule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
* [AUTOMATED] wip(analysis): libctypes second round of named libc structs Mined the libc/POSIX-named ptr_struct ground-truth pool from the DWARF twins of the 444-slice corpus and added the slots that pay. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip(analysis): obstack fixture, stage passes 11-12, unit tests Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: spec prose, phases.toml summary, options.md, stages baseline Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: probe/test fixtures repointed, feature bundle analysis+plan Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: re-capture phase_catalog fixture, move the ghidra-sim C-line pins Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: feature record.json Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: refresh the module header for the second round Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): cite the twin's debug info for the nl witness Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): record the export compile-error cost Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): tidy the unreachable half of the ranked pool Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): list every newly-wrong row Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the speed block and the gate results Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the quieter-moment speed confirmation Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] fix(analysis): the obstack size slots follow the channel, not the corpus gnulib's copy of obstack.c declares its size type size_t; the installed glibc header declares int. The table asserted size_t for both, so an image that IMPORTS _obstack_begin/_obstack_newchunk from glibc (the five dpkg programs at each optimization level, 15 slices of the same results tree) got a false declaration, and the caller of a two-line glibc-obstack program went from `void f(int n)` to `void f(unsigned int n)` with two inserted casts. Split the channel: LIBC_DEFINED_NAMED (size_t) is seeded only from the names the image defines and does not also import, LIBC_IMPORTED_OBSTACK (int) from the import channel by name and by resolver address. Corrects the module and spec prose that claimed obstack is never an import. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the gzip row in full, and the two obstack channels The single worse typesweep row said "a by-value struct stat local that becomes a byte blob". What it actually is: char v5 [80] handed to an lstat that writes 144 bytes, with st_atim/st_mtim detached into locals the body reads and nothing writes. State that, say what causes it (the timespec * slot on utimensat/futimens -- reverting those two slots brings stat v5 back), and record the measurement it is kept on: over the 30 corpus slices that import either name, 122 functions gain a timespec rendering and this is the only new under-declared stat, against 7 that main already prints in those same slices. Also: rebased onto argclobber (#689), stages baseline re-recorded, PR body cut under a screen, and the statfs/export redeclaration noted beside the option's documented export cost. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] test(stages): pin the imported obstack channel end to end libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): re-measure on the rebased base The 444-slice typesweep was run again in full after the rebase onto argclobber (#689), base arm built from origin/main's kuna_libctypes.rs + protos/mod.rs in this tree. Identical to the first run down to the per-variable tables: 1,349 -> 1,353 perfect, mean .3403 -> .3417, 147 newly correct / 6 newly wrong, 91 improved / 1 worse. Also completes the newly-correct breakdown, which was listing 139 of the 147. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the channel split's load cost min-of-9 interleaved `kuna functions` over -O2 tar: 0.144s before the extra defined-name walk, 0.142s after. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] style(analysis): shorten the inline note at the obstack seam Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the channel split's blast radius decompile-all over five whole binaries, the two builds differing only by the split: grep/tar/ls/gzip byte-identical, dpkg-query moves 7 lines. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] style(analysis): present-name set is module-private again Nothing outside protos/mod.rs reads it now that the obstack seam takes the defined-name set. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): disclose the sigaction frame split The `sigfillset(sigset_t *)` slot gives the `sa_mask` sub-object its own identity, so a 152-byte `sigaction` frame slot splits at 136 and the `sa_flags` store lands outside the object handed to `sigaction()`. Measured by ablating that one table row: no `sigaction` declaration moves anywhere in the 444 scored slices (6 of them import `sigfillset`), and in a disjoint openssh -O2 sweep exactly one function per binary changes, all of them `ssh_signal`. The shape already ships through `sigemptyset`, which prints the identical split on the ablated build. Also records the `statfs` name collision as it appears in plain `decompile-all`, not only in a project export. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the sigaction repro in full The mitigation claim is only checkable with the program it was measured on. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): re-measure the typesweep on the new base Third full run of both arms, this time at 69d252d. The perfect counts, the improved/worse split and every per-variable table are unchanged; only the pooled mean moves, 0.3403 -> 0.3405 off and 0.3417 -> 0.3419 on, which is #694 lifting both arms alike. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the utmp rows measured, the 32-bit size limit, the re-derived fixture swap Adds three sections to the feature analysis: the utmp/utmpx rows reaching a caller's own local on who/logoutd/runlevel (they ship on a pool count, not a sweep delta, and this is what they buy); the table's sizes being glibc x86-64 with nothing scaling them by word size, and what that is confined to; and the export fixture swap re-derived under #693's callee-first schedule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): record the rebase onto the callee-first export The gate block now names the base it was run on, and a new section records how the two repointed fixtures were re-derived under that schedule, the nine-binary `libctypes off` identity against a build of the new base, and why the type sweep did not need re-running (`decompile-all --json` is byte-identical between the two bases). The timespec rows are recorded as a decision rather than a disclosure. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the workspace suite result on the rebased tree Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] feat(analysis): drop the sigfillset row from libctypes It splits a struct sigaction frame slot in openssh's ssh_signal and buys nothing in the mined pool. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] feat(analysis): drop the two-element time slots and the sigset_t sub-object rows utimensat/futimens/utimes/futimesat take a two-element array; naming one element shrinks the caller's frame object (gzip lutimens reads a stat tail nothing writes; scp/sftp hand utimes 16 of 32 bytes). sigsuspend, pthread_sigmask, sigdelset, sigismember and sigwait split a struct sigaction local when handed &sa.sa_mask. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): the spec and option row say which slots are left out and why Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): round-5 measurements, the dropped rows, off-pool notes for every kept row Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): the frame checker, the sigset_t repro and the 15-binary hunk classification Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): record.json for round 5 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] test(analysis): the frame-splitting slots stay out of the libctypes tables Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] chore(libcstructs): re-derive counts and generated files after rebase Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): round-5 speed block and the gates on the rebased tree Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): the gates on the #703-rebased tree Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
kuna decompile-projectandkuna decompile-allput different records underthe same
struct_N. Both synthesize structures into a ledger that numbers themin the order the program is visited in, and
decompile-alldecompiles calleesfirst (
--option protoorder, on by default) while the export kept its ownaddress-order schedule. So a reader who resolves a
struct_1 *from one surfaceagainst the declaration on the other reads the wrong layout, and neither surface
says so.
On coreutils
du-O2 not one of the 28struct_Nnames the two surfacesshare names the same record; with
--option protoorder off, which puts bothback on one order, all 29 do.
The fix
decompile-projecttakes the callee-first order, under the same conditionsdecompile-alltakes it — onecallee_first_decision, one loop, the export'sown per-function options. A
struct_Nthen means one record on both.protoorder's, and--option protoorder offturns it off here exactly as it does on
decompile-all.--streamwrites each body as it finishes and cannot buffer a plan, so itkeeps the address-order schedule; it and
decompile-graphstill warn when theoption is named. Under
--jobs Nthe export prints the notedecompile-allprints, and the pool's replay line now names the serial run it replays,
--jobs 1 --option protoorder off.The campaign's layout instrument reads types from one surface and layouts from
the other, so this join is the whole of the regression that
docs/decbench/typecampaign/results.md§C.4 attributed to protoorderoverriding a caller's measured layout. It does not:
du-O2 installs the same36 layouts in both arms, 32 field-identical and 4 differing only in a field's
type spelling.
docs/features/projectorder/analysis.mdhas the instrumentation.The tests
decompile_project_cli.rs (a_struct_name_means_the_same_record_in_the_export_and_in_decompile_all): everystruct struct_N {…}the export declares is the blockdecompile-all --option structdefs onprints for that name, in the default and theprotoorder offarm. Three of the fixture's five blocks disagree without the fix.
tests/cli/sharded-project-export-keeps-serial-structs.jsonfollows the replayline.
decompile-all --jsonis byte-identical before and after on 20 binaries acrosseight projects and three optimization levels, and the 444-slice type sweep is
unchanged (1,349 perfect, mean 0.3405). The export's own output changes for 824
of 2,918 functions on the eight
fmt/ls/sort/dubuilds, and after thechange it renders 2,918 of 2,918 exactly as
decompile-alldoes (before:2,094). Pooled claimed-field precision against DWARF goes 0.4710 → 0.7836
filler-counted (F1 0.1135 → 0.1882), and 0.5520 → 0.8709 fields-only,
0.024 under the 0.8945 of the build before
protoorder: the default claims 176more fields than an option-off run (1,007 vs 831), on parameters whose record
only the callee sees, so recall and F1 both finish above that build. Export speed, interleaved:
fmt-O2−5.0% and
sort-O2 −0.4% (min-of-15);du-O0 +4.87% min / −0.40% median(min-of-30, pooled over two sittings that disagreed on which statistic moved),
inside the +5% budget.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG