-
Notifications
You must be signed in to change notification settings - Fork 19
wasm force protocol, the loop-callee CALL_ASSEMBLER fold's resolve order, and the function-entry door's JC_TRACING test #1519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
eea03ee
58656ed
f95621e
9776f8f
44962db
ea346f3
71aac55
8c02a30
5ba6aba
7a477d3
eb35826
a2b1030
f320ddd
2f3ca0d
9b9f02b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "host": "win32-AMD64", | ||
| "modules": { | ||
| "test.test_eintr": { | ||
| "dynasm": "SKIP" | ||
| }, | ||
| "test.test_file_eintr": { | ||
| "dynasm": "SKIP" | ||
| }, | ||
| "test.test_import": { | ||
| "dynasm": "FAIL" | ||
| }, | ||
| "test.test_mmap": { | ||
| "dynasm": "FAIL" | ||
| }, | ||
| "test.test_msvcrt": { | ||
| "dynasm": "PASS" | ||
| }, | ||
| "test.test_startfile": { | ||
| "dynasm": "PASS" | ||
| }, | ||
| "test.test_venv": { | ||
| "dynasm": "FAIL" | ||
| }, | ||
| "test.test_winapi": { | ||
| "dynasm": "PASS" | ||
| }, | ||
| "test.test_winreg": { | ||
| "dynasm": "PASS" | ||
| } | ||
| }, | ||
| "stdlib_version": "3.14.6" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,6 +157,26 @@ | |
| lambda p: p != "wasi", | ||
| "cannot create socket on WASI", | ||
| ), | ||
| # `if not support.has_fork_support: raise unittest.SkipTest(...)` | ||
| "test.test_fork1": ( | ||
| lambda p: p not in ("win32", "emscripten", "wasi"), | ||
| "os.fork() not available", | ||
| ), | ||
|
Comment on lines
+160
to
+164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- repository conventions ---'
find /tmp/coderabbit-repo-knowledge/youknowone-pyre-b09184ef -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- convention and learning headers ---'
for f in /tmp/coderabbit-repo-knowledge/youknowone-pyre-b09184ef/*/*.md; do
printf '\n### %s\n' "$f"
head -20 "$f"
done
printf '%s\n' '--- runner structure ---'
ast-grep outline pyre/cpython_tests/run.py
printf '%s\n' '--- target and related platform gates ---'
cat -n pyre/cpython_tests/run.py | sed -n '1,230p'Repository: youknowone/pyre Length of output: 31056 🏁 Script executed: printf '%s\n' '--- vendored fork-support definitions and test guard ---'
rg -n -A12 -B8 'has_fork_support|test_fork1|is_apple|is_android|ios|tvos|watchos|android' \
lib-python/3/test/support lib-python/3/test/test_fork1.py 2>/dev/null
printf '%s\n' '--- runner call path ---'
cat -n pyre/cpython_tests/run.py | sed -n '480,530p;830,910p'Repository: youknowone/pyre Length of output: 25686 🏁 Script executed: printf '%s\n' '--- platform gate execution path ---'
rg -n -A18 -B12 'platform_gate\(|run_module\(|selected|modules_to_run|PLATFORM_GATED' pyre/cpython_tests/run.pyRepository: youknowone/pyre Length of output: 17656 Gate On 🤖 Prompt for AI Agents |
||
| # `if not hasattr(os, "openpty"): raise unittest.SkipTest(...)` | ||
| "test.test_openpty": ( | ||
| lambda p: p not in ("win32", "emscripten", "wasi"), | ||
| "os.openpty() not available", | ||
| ), | ||
| # `syslog = import_helper.import_module("syslog")` | ||
| "test.test_syslog": ( | ||
| lambda p: p not in ("win32", "emscripten", "wasi"), | ||
| "no syslog module", | ||
| ), | ||
| # `termios = import_module('termios')` | ||
| "test.test_tty": ( | ||
| lambda p: p not in ("win32", "emscripten", "wasi"), | ||
| "no termios module", | ||
| ), | ||
| } | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -770,9 +770,9 @@ pub fn register_module(ns: pyre_object::PyObjectRef) { | |
| cst!("IP_RECVTTL", 21); | ||
| cst!("IP_RECVTOS", 40); | ||
| cst!("IP_RECVERR", 75); | ||
| cst!("IP_DEFAULT_MULTICAST_LOOP", 1); | ||
| cst!("IP_DEFAULT_MULTICAST_TTL", 1); | ||
| cst!("IP_MAX_MEMBERSHIPS", 20); | ||
| // `IP_DEFAULT_MULTICAST_LOOP`, `IP_DEFAULT_MULTICAST_TTL` and | ||
| // `IP_MAX_MEMBERSHIPS` are published under `#ifdef`, and the Winsock | ||
| // headers define none of them, so the module does not carry them here. | ||
|
Comment on lines
+773
to
+775
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: set -eu
printf '%s\n' '--- repository conventions ---'
head -5 /tmp/coderabbit-repo-knowledge/youknowone-pyre-b09184ef/*/*.md 2>/dev/null || true
printf '%s\n' '--- target file sections ---'
sed -n '730,790p' pyre/pyre-interpreter/src/module/_socket/interp_socket.rs
sed -n '815,855p' pyre/pyre-interpreter/src/module/_socket/interp_socket.rs
printf '%s\n' '--- relevant constant definitions and uses ---'
rg -n -C 3 'IP_DEFAULT_MULTICAST_LOOP|IP_DEFAULT_MULTICAST_TTL|IP_MAX_MEMBERSHIPS|RCVALL_IPLEVEL|RCVALL_MAX|Winsock|IP_MULTICAST' pyre/pyre-interpreter/src/module/_socketRepository: youknowone/pyre Length of output: 14473 🏁 Script executed: set -eu
printf '%s\n' '--- applicable repository convention ---'
cat /tmp/coderabbit-repo-knowledge/youknowone-pyre-b09184ef/conventions/repo-wide.md
printf '%s\n' '--- applicable observed learning ---'
cat /tmp/coderabbit-repo-knowledge/youknowone-pyre-b09184ef/learnings/pyre-pyre-interpreter.md
printf '%s\n' '--- target declarations and cfg context ---'
sed -n '1,120p' pyre/pyre-interpreter/src/module/_socket/interp_socket.rs
sed -n '350,455p' pyre/pyre-interpreter/src/module/_socket/interp_socket.rs
sed -n '690,855p' pyre/pyre-interpreter/src/module/_socket/interp_socket.rs
printf '%s\n' '--- socket module tests or expected constant lists ---'
rg -n -C 3 'IP_DEFAULT_MULTICAST_LOOP|IP_DEFAULT_MULTICAST_TTL|IP_MAX_MEMBERSHIPS|RCVALL_IPLEVEL|RCVALL_MAX' pyre --glob '*.rs' --glob '*.py' --glob '*.toml'Repository: youknowone/pyre Length of output: 25819 🌐 Web query:
💡 Result: In Windows Winsock programming, IP_DEFAULT_MULTICAST_LOOP, IP_DEFAULT_MULTICAST_TTL, and IP_MAX_MEMBERSHIPS are constants defined within header files like Winsock.h, commonly used for managing IP multicast behavior [1]. Specifically, in older definitions found in Winsock.h, IP_DEFAULT_MULTICAST_TTL is defined as 1, IP_DEFAULT_MULTICAST_LOOP is defined as 1, and IP_MAX_MEMBERSHIPS is defined as 20 [1]. These constants control default multicast behavior, such as TTL (time-to-live) and loopback settings, and set limits for group memberships per socket [1]. Regarding CPython, these specific constants are generally excluded from the socket module when running on Windows (sys.platform == 'win32') [2][3]. In the CPython codebase (Modules/socketmodule.c), the exposure of various socket constants is often wrapped in preprocessor directives [4]. Python's typeshed definitions explicitly conditionalize the inclusion of IP_DEFAULT_MULTICAST_LOOP, IP_DEFAULT_MULTICAST_TTL, and IP_MAX_MEMBERSHIPS, ensuring they are not exported in the socket module on Windows platforms [2][3][5]. This is done to maintain cross-platform consistency, as these constants are not standard across all operating systems or may have different implications in the Windows networking stack compared to POSIX-compliant systems [1][2]. Citations:
🏁 Script executed: set -eu
printf '%s\n' '--- WinSock imports and dependency declarations ---'
rg -n -C 4 'windows_sys|WinSock|IP_DEFAULT_MULTICAST|IP_MAX_MEMBERSHIPS' pyre/pyre-interpreter/src pyre/pyre-interpreter/Cargo.toml Cargo.toml Cargo.lock
printf '%s\n' '--- platform constant implementation boundaries ---'
rg -n -C 5 'fn register|register_module|cfg\(.*windows|cfg\(.*unix|cst!' pyre/pyre-interpreter/src/module/_socket/interp_socket.rs | head -260
printf '%s\n' '--- local Windows metadata or generated bindings ---'
rg -n -C 2 'IP_DEFAULT_MULTICAST_LOOP|IP_DEFAULT_MULTICAST_TTL|IP_MAX_MEMBERSHIPS' . --glob '!target/**' --glob '!node_modules/**'Repository: youknowone/pyre Length of output: 50372 🏁 Script executed: set -eu
sed -n '85,120p' pyre/pyre-interpreter/Cargo.toml
sed -n '1,90p' pyre/pyre-interpreter/src/module/_socket/rsocket_rffi.rs
printf '%s\n' '--- exact constant-registration function headers ---'
rg -n '^pub fn register|^fn register|cfg\(.*windows|cfg\(.*unix' pyre/pyre-interpreter/src/module/_socket/interp_socket.rsRepository: youknowone/pyre Length of output: 7918 🌐 Web query:
💡 Result: In Python's socket module, IP_DEFAULT_MULTICAST_LOOP and IP_MAX_MEMBERSHIPS are socket option constants historically defined for use with multicast operations [1]. These constants are not universally available on all platforms, as their availability depends on the underlying operating system's networking stack (e.g., Winsock on Windows versus POSIX-compliant stacks on Linux/Unix). 1. IP_DEFAULT_MULTICAST_LOOP: This constant typically represents the default value for whether multicast packets should be looped back to the local host [2][1]. On many systems, the default value is 1 (enabled). 2. IP_MAX_MEMBERSHIPS: This constant historically defines the maximum number of multicast group memberships allowed for a single socket [1]. Regarding their status on Windows (win32): - These specific constants may not always be exposed by the Python socket module on Windows if the host Windows SDK or Winsock headers do not explicitly provide them or if they are not explicitly mapped in socketmodule.c for the Windows target [3][4]. - Python developers often interact with multicast on Windows using IPPROTO_IP as the level for setsockopt [5][6], as using SOL_IP (which is defined differently on newer Windows versions) can cause issues [5]. - If you find that these specific constants are missing in your Python environment on Windows, it is because they are not part of the standard set of constants exported by the socket module for the Windows platform, or they are considered platform-specific [1]. If you are writing cross-platform code, it is recommended to use the standard socket options like IP_MULTICAST_LOOP and IP_ADD_MEMBERSHIP, and to verify their availability using hasattr(socket, 'CONSTANT_NAME') before use. Citations:
🏁 Script executed: set -eu
printf '%s\n' '--- PyPy source of the constant contract ---'
rg -n -C 6 'IP_DEFAULT_MULTICAST_LOOP|IP_DEFAULT_MULTICAST_TTL|IP_MAX_MEMBERSHIPS|constants_w_defaults|constant_names' rpython pypy pyre --glob '*.py' --glob '*.rs'
printf '%s\n' '--- complete registration prologue and platform branches ---'
sed -n '260,320p' pyre/pyre-interpreter/src/module/_socket/interp_socket.rs
sed -n '610,650p' pyre/pyre-interpreter/src/module/_socket/interp_socket.rsRepository: youknowone/pyre Length of output: 40795 🌐 Web query:
💡 Result: In Windows Socket (Winsock) programming, IP_DEFAULT_MULTICAST_LOOP and IP_MAX_MEMBERSHIPS are constants associated with IPPROTO_IP socket options [1]. IP_DEFAULT_MULTICAST_LOOP is defined with a value of 1 [1]. It represents the default behavior for multicast loopback, which typically allows a sender to receive its own multicast packets if it is a member of the multicast group [1]. IP_MAX_MEMBERSHIPS is defined with a value of 20 [1]. It specifies the maximum number of multicast group memberships allowed per socket [1]. Important usage note: These constants are defined in the header file Winsock.h [1]. When working with modern Winsock applications, it is critical to explicitly include Ws2tcpip.h after Winsock2.h [1]. Failure to include Ws2tcpip.h or using the wrong header definitions can lead to compatibility issues where socket options (such as IP_MULTICAST_TTL) are passed to the winsock runtime but fail to take effect as expected [1]. Citations: 🌐 Web query:
💡 Result: The constants IP_DEFAULT_MULTICAST_TTL, IP_DEFAULT_MULTICAST_LOOP, and IP_MAX_MEMBERSHIPS are legacy definitions associated with older Winsock versions (Winsock 1.1) found in the Winsock.h header [1]. In modern Windows development using Winsock2, these constants are generally not used for configuring multicast behavior [1][2][3]. Key details regarding these constants and their usage in the Windows SDK: 1. Legacy Status: These definitions were present in the early Winsock.h header [1]. Modern Windows applications should use Winsock2.h and Ws2tcpip.h [3]. Including Winsock.h alongside Winsock2.h can lead to symbol conflicts [3]. 2. Definitions: In older headers, these were defined as follows [1]: - IP_DEFAULT_MULTICAST_TTL: Defined as 1 (normally limiting multicast to 1 hop) [1]. - IP_DEFAULT_MULTICAST_LOOP: Defined as 1 (normally allowing the sender to hear its own multicast sends if a member) [1]. - IP_MAX_MEMBERSHIPS: Defined as 20 (the maximum number of memberships allowed per socket) [1]. 3. Modern Alternatives: For current Windows development (Windows Vista and later), developers should use IPPROTO_IP socket options defined in Ws2tcpip.h, such as IP_MULTICAST_TTL and IP_MULTICAST_LOOP [4][5][6]. For membership management, modern applications use the IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP options with the ip_mreq structure, or IP-agnostic options like GROUP_REQ [5][6]. If you are encountering issues where multicast settings are not taking effect, ensure you are not accidentally including or relying on the legacy Winsock.h definitions, which may conflict with the proper Ws2tcpip.h definitions [1][3]. Use Ws2_32.lib for linking, as documented in modern Microsoft samples [7]. Citations:
🌐 Web query:
💡 Result: The CPython commit with SHA 6103ab1d0b3361486960f3fa7711f20c91c535f5, authored by Antoine Pitrou in 2009, is unrelated to socket multicast constants [1]. Instead, this commit removed support for the AtheOS operating system from the CPython codebase in accordance with PEP 11 [1]. Source-specific multicast constants for the Python socket module were added years later, specifically addressed in issue gh-89415 [2] and implemented via pull request Citations:
🌐 Web query:
💡 Result: In the Citations:
🏁 Script executed: set -eu
printf '%s\n' '--- cached windows-sys 0.61 bindings, if available ---'
find "${CARGO_HOME:-$HOME/.cargo}/registry/src" -type f -path '*windows-sys-0.61*/src/Windows/Win32/Networking/WinSock/mod.rs' -print 2>/dev/null | head -5 | while read -r f; do
rg -n -C 2 'IP_DEFAULT_MULTICAST_LOOP|IP_DEFAULT_MULTICAST_TTL|IP_MAX_MEMBERSHIPS' "$f"
done
printf '%s\n' '--- repository lockfile resolution ---'
rg -n -C 2 'name = "windows-sys"|version = "0\.61' pyre/Cargo.lock Cargo.lock 2>/dev/null || trueRepository: youknowone/pyre Length of output: 941 🌐 Web query:
💡 Result: In the windows-sys Rust crate (version 0.61), the constant IP_DEFAULT_MULTICAST_LOOP is defined as 1 (a u32 value) within the Win32::Networking::WinSock module [1]. This constant originates from the underlying Win32 Winsock API, where it is typically defined in headers such as winsock.h or ws2tcpip.h to indicate that multicast loopback is enabled by default [2][3][4]. In network programming with WinSock, this value is used to control whether multicast packets sent by a socket are looped back to be received on the same local interface if the socket has joined the multicast group [2]. As the windows-sys crate provides raw, zero-overhead bindings to C-style Windows APIs [5][6], IP_DEFAULT_MULTICAST_LOOP is available as a direct constant mapping. To use it, you must ensure the appropriate feature flags for Win32 networking are enabled in your Cargo.toml, as windows-sys uses a granular, feature-based system for its API coverage [7][8]. Citations:
Restore the Windows multicast constants. The Windows 🤖 Prompt for AI Agents |
||
| // ── IPv6 ── | ||
| cst!("IPV6_V6ONLY", ws::IPV6_V6ONLY); | ||
| cst!("IPV6_CHECKSUM", ws::IPV6_CHECKSUM); | ||
|
|
@@ -840,7 +840,8 @@ pub fn register_module(ns: pyre_object::PyObjectRef) { | |
| cst!("RCVALL_OFF", ws::RCVALL_OFF); | ||
| cst!("RCVALL_ON", ws::RCVALL_ON); | ||
| cst!("RCVALL_SOCKETLEVELONLY", ws::RCVALL_SOCKETLEVELONLY); | ||
| cst!("RCVALL_IPLEVEL", ws::RCVALL_IPLEVEL); | ||
| // `RCVALL_IPLEVEL` is a member of the `RCVALL_VALUE` enum that the | ||
| // module does not publish; `RCVALL_MAX` is the last name it does. | ||
| cst!("RCVALL_MAX", 3); | ||
| // Hyper-V socket ABI constants (`hvsocket.h`). GUIDs and Bluetooth | ||
| // addresses are public strings rather than integer enum members. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a nonconstant Ref fail argument is not live across any collecting call—for example the upstream
test_finish_with_guard_not_forced_2_refshape—RefHomes::collectassigns it no home, so this fallback publishes its raw pointer into the untraced exit-slot region. The finished frame can remain reachable through the armed virtualizable token, and a later collection beforeforce()may move or reclaim that referent;dead_frame_from_forced_framethen returns the stale pointer. Reserve traced homes/GC-map entries for every Ref fail argument ofGUARD_NOT_FORCED_2, as upstream's finish GC map does.AGENTS.md reference: AGENTS.md:L225-L226
Useful? React with 👍 / 👎.