[issue47046] Add `f_state` attribute to FrameObjects.

2022-04-08 Thread Mark Shannon


Mark Shannon  added the comment:

Don't you need to know if a "call" event is a call or the resumption of a 
generator?

--

___
Python tracker 
<https://bugs.python.org/issue47046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-04-08 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30439
pull_request: https://github.com/python/cpython/pull/32413

___
Python tracker 
<https://bugs.python.org/issue40421>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47248] Possible slowdown of regex searching in 3.11

2022-04-07 Thread Mark Shannon


New submission from Mark Shannon :

The 3 regular expression benchmarks in the pyperformance suite, regex_v8, 
regex_effbot and regex_dna show slowdowns between 3% and 10%.

Looking at the stats, nothing seems wrong with specialization or the memory 
optimizations.

Which strongly suggests a regression in the sre module itself, but I can't say 
so for certain.

--
keywords: 3.11regression
messages: 416923
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Possible slowdown of regex searching in 3.11
type: performance
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue47248>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47009] Streamline list.append for the common case

2022-04-05 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 6c6e0408a663c1f53dad403f54a18d444da39cb7 by Dennis Sweeney in 
branch 'main':
bpo-47009: Let PRECALL_NO_KW_LIST_APPEND do its own POP_TOP (GH-32239)
https://github.com/python/cpython/commit/6c6e0408a663c1f53dad403f54a18d444da39cb7


--

___
Python tracker 
<https://bugs.python.org/issue47009>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45317] Document the removal the usage of the C stack in Python to Python calls

2022-04-04 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +30367
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32304

___
Python tracker 
<https://bugs.python.org/issue45317>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44800] Code readability: rename InterpreterFrame to `_Py_framedata`

2022-04-04 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 8a349eb30b54bab9a7146fc10e3379c3cacaa19e by Mark Shannon in 
branch 'main':
Revert "bpo-44800: Document internal frame naming conventions (GH-32281)" 
(#32301)
https://github.com/python/cpython/commit/8a349eb30b54bab9a7146fc10e3379c3cacaa19e


--

___
Python tracker 
<https://bugs.python.org/issue44800>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47215] Add "unstable" frame stack api

2022-04-04 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +30366
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32303

___
Python tracker 
<https://bugs.python.org/issue47215>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47215] Add "unstable" frame stack api

2022-04-04 Thread Mark Shannon


New submission from Mark Shannon :

We need to provide an API to create, swap and free frame stacks for greenlets.

Since this is primarily for greenlets (and any other stackful coroutines 
libraries that want to use it) it will be "unstable".

In this case, by "unstable" I mean:
1. Starts with an underscore
2. Gets PyAPI_FUNC annotations, so we don't strip the symbols from the 
executable
3. Undocumented, except for comments that say it is unstable.

The API will be:

```
typedef struct _frame_stack {
_PyStackChunk *current_chunk;
PyObject **top;
PyObject **limit;
int chunk_size;
} _PyFrameStack;

PyAPI_FUNC(void) _PyFrameStack_Init(_PyFrameStack *fs, int chunk_size);
PyAPI_FUNC(void) _PyFrameStack_Swap(_PyFrameStack *fs);
PyAPI_FUNC(void) _PyFrameStack_Free(_PyFrameStack *fs);

```

--
assignee: Mark.Shannon
components: C API
messages: 416665
nosy: Mark.Shannon, brandtbucher
priority: normal
severity: normal
stage: needs patch
status: open
title: Add "unstable" frame stack api
type: enhancement
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue47215>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44800] Code readability: rename InterpreterFrame to `_Py_framedata`

2022-04-04 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30363
pull_request: https://github.com/python/cpython/pull/32301

___
Python tracker 
<https://bugs.python.org/issue44800>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47172] Make virtual opcodes in the compiler negative and is_jump() identify only proper jumps

2022-04-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 997ba5d126f5040d5b7536f73bc89049e9f9421d by Irit Katriel in 
branch 'main':
bpo-47172: Compiler enhancements (GH-32200)
https://github.com/python/cpython/commit/997ba5d126f5040d5b7536f73bc89049e9f9421d


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue47172>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47186] split JUMP_IF_NOT_EXC/EG_MATCH into CHECK_EXC/EG_MATCH + jump

2022-04-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 04e07c258f4f2ac85e25355242a113f98a706f04 by Irit Katriel in 
branch 'main':
bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231)
https://github.com/python/cpython/commit/04e07c258f4f2ac85e25355242a113f98a706f04


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue47186>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-04-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset ae9de82e321581e1906c6ef2a7ad83ab30ae3325 by Brandt Bucher in 
branch 'main':
bpo-46841: Use a `bytes` object for `_co_code_adaptive` (GH-32205)
https://github.com/python/cpython/commit/ae9de82e321581e1906c6ef2a7ad83ab30ae3325


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-04-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset bd2e47c8830d1b2869f2b4345945a5e0c3b4e3fb by Brandt Bucher in 
branch 'main':
bpo-46841: Avoid unnecessary allocations in code object comparisons (GH-3)
https://github.com/python/cpython/commit/bd2e47c8830d1b2869f2b4345945a5e0c3b4e3fb


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47009] Streamline list.append for the common case

2022-04-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset a0ea7a116ce52a178c02d42b684089758bd7f355 by Dennis Sweeney in 
branch 'main':
bpo-47009: Streamline list.append for the common case (GH-31864)
https://github.com/python/cpython/commit/a0ea7a116ce52a178c02d42b684089758bd7f355


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue47009>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-03-31 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 74b95d86e0f14603f878c4df3133bc8a93f8f80a by Mark Shannon in 
branch 'main':
bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)
https://github.com/python/cpython/commit/74b95d86e0f14603f878c4df3133bc8a93f8f80a


--

___
Python tracker 
<https://bugs.python.org/issue40421>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47120] Make all jump opcodes relative

2022-03-31 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset a00518d9ad9a8f408a9699191019d75dd8406c32 by Irit Katriel in 
branch 'main':
bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD 
(GH-32115)
https://github.com/python/cpython/commit/a00518d9ad9a8f408a9699191019d75dd8406c32


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue47120>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Mark Shannon


Mark Shannon  added the comment:

The problem in the example you give is the need for the cast in the first 
place. If `func` were a `PyCFunctionObject *` instead of a `PyObject *`, then 
there would be no cast.


Making the casts explicit serves as a reminder that a type check is needed.

```
PyObject *func = ...;
int flags = PyCFunction_GET_FLAGS(func);
```

is dangerous.

```
PyObject *obj = ...;
if (PyCFunction_Check(obj)) {
PyCFunctionObject *func = (PyCFunctionObject *)obj;
int flags = func->m_ml->ml_flags;
```

is safe.

--

___
Python tracker 
<https://bugs.python.org/issue47164>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Mark Shannon


Mark Shannon  added the comment:

I think that adding macros makes readability worse.

The macro is only more readable if you already know what it does.
If you don't, then you need to look up the macro, and understand the cast in 
the macro (which is harder than understanding the original cast).


In general, I find the excessive use of macros and tiny inline function 
obscures the meaning of code, and makes it hard to reason about what the code 
is doing.

A few well chosen macros (like Py_INCREF(), etc) can definitely help 
readability, but if there are too many then anyone reading the code ends up 
having to lookup loads of macro definitions to understand the code.



Without the macro, the reader needs to parse the cast, which is admittedly a

--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue47164>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-25 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset cca43b7d64f47ea921d0f7a347ae1a839c5463c3 by Dennis Sweeney in 
branch 'main':
bpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318)
https://github.com/python/cpython/commit/cca43b7d64f47ea921d0f7a347ae1a839c5463c3


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue47053>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-03-25 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30190
pull_request: https://github.com/python/cpython/pull/32114

___
Python tracker 
<https://bugs.python.org/issue40421>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42197] Disable automatic update of frame locals during tracing

2022-03-25 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset d7163bb35d1ed46bde9affcd4eb267dfd0b703dd by Mark Shannon in 
branch 'main':
bpo-42197: Don't create `f_locals` dictionary unless we actually need it. 
(GH-32055)
https://github.com/python/cpython/commit/d7163bb35d1ed46bde9affcd4eb267dfd0b703dd


--

___
Python tracker 
<https://bugs.python.org/issue42197>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42917] Block stack size for frame objects should be dynamically sizable

2022-03-25 Thread Mark Shannon


Mark Shannon  added the comment:

With the introduction of zero cost exceptions, there is no block stack.

--
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue42917>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42197] Disable automatic update of frame locals during tracing

2022-03-22 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30147
pull_request: https://github.com/python/cpython/pull/32055

___
Python tracker 
<https://bugs.python.org/issue42197>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42917] Block stack size for frame objects should be dynamically sizable

2022-03-22 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30145
pull_request: https://github.com/python/cpython/pull/32055

___
Python tracker 
<https://bugs.python.org/issue42917>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

I'm looking into adding two new APIs.
One to round out the getters for FrameObject and one to introspect the internal 
frame stack.

It would probably make more sense to add this capability to the frame stack 
API, as it would avoid creating the frame object as well as the locals 
dictionary.

E.g. `PyFrameStack_GetVar(int depth, PyObject *name)`

--

___
Python tracker 
<https://bugs.python.org/issue47092>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46724] Odd Bytecode Generation in 3.10

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

I think this is fixed (for 3.11 at least) by 
https://github.com/python/cpython/pull/31888

--

___
Python tracker 
<https://bugs.python.org/issue46724>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47045] Remove the RESUME instruction

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 49daf6dba8178c5ae5d4d65408b20566d39c36a8 by Mark Shannon in 
branch 'main':
bpo-47045: Remove `f_state` field (GH-31963)
https://github.com/python/cpython/commit/49daf6dba8178c5ae5d4d65408b20566d39c36a8


--

___
Python tracker 
<https://bugs.python.org/issue47045>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47085] missing frame.f_lineno on JUMP_ABSOLUTE

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

The `JUMP_ABSOLUTE` doesn't have a line number, as it doesn't correspond to any 
source.

The jump back to the top could follow either the `if i >= 0:` or the `pass`, so 
cannot have a line number.

Don't expect every bytecode to map directly back to the source, especially if 
it cannot raise an exception.

Per-line tracing is well defined by PEP 626. Per-opcode tracing is not.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue47085>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

You are on own if you create code objects by calling `types.CodeType`.
The docs could be a lot clearer about that, though.

--

___
Python tracker 
<https://bugs.python.org/issue45563>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-21 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 2bde6827ea4f136297b2d882480b981ff26262b6 by Brandt Bucher in 
branch 'main':
bpo-46841: Quicken code in-place (GH-31888)
https://github.com/python/cpython/commit/2bde6827ea4f136297b2d882480b981ff26262b6


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47045] Remove the RESUME instruction

2022-03-17 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +30052
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31963

___
Python tracker 
<https://bugs.python.org/issue47045>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47046] Add `f_state` attribute to FrameObjects.

2022-03-17 Thread Mark Shannon


New submission from Mark Shannon :

When tracing, the event supplied is insufficient to determine what is actually 
happening.

E.g. A "call" event could be a call to a function or resuming a generator or 
coroutine.

Adding a state field to the FrameObject would allow these cases to be 
disambiguated without having to make dubious deductions from `f_lasti` or other 
frame attributes.

The proposed states would be:

FRAME_CREATED# Frame created, but not executed at all
FRAME_SUSPENDED  # Frame suspended after yield or yield from
FRAME_EXECUTING  # Frame is executed normally
FRAME_COMPLETED  # Frame has completed 
FRAME_CLEARED# Frame has been cleared


Ned, any other states that you might need to know about?

--
messages: 415427
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
status: open
title: Add `f_state` attribute to FrameObjects.

___
Python tracker 
<https://bugs.python.org/issue47046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47045] Remove the RESUME instruction

2022-03-17 Thread Mark Shannon


New submission from Mark Shannon :

The RESUME instruction was added to make resumption points explicit in the 
bytecode. This makes it easier to implement tracing, quickening, and interrupt 
checks as there is an explicit place to perform these checks.

Unfortunately, it also has considerable overhead. So we should remove it.
To do that, we need to:
1. Remove f_state from the InterpreterFrame so we don't need to update it.
2 .Quicken automatically in the adaptive instructions.
3. Check the evalbreaker when resuming a frame in the interpreter.
4. Add some metadata to the code object, so that we know when to fire "call" 
events when tracing.

--
assignee: Mark.Shannon
messages: 415424
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Remove the RESUME instruction
type: performance

___
Python tracker 
<https://bugs.python.org/issue47045>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-03-17 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-03-16 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30025
pull_request: https://github.com/python/cpython/pull/31933

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45923] Improve performance of sys.settracing based tools.

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 099f75614100e88ed90b68d20a51a8d9c22f81a7 by Mark Shannon in 
branch 'main':
bpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908)
https://github.com/python/cpython/commit/099f75614100e88ed90b68d20a51a8d9c22f81a7


--

___
Python tracker 
<https://bugs.python.org/issue45923>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46817] Add a line-start table to the code object.

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:

sys.settrace line events cannot use the co_lines table. They need additional 
state, as we don't want to trace the same line twice (unless there is a 
backwards jump).

Using the start of a entry in `co_lines` doesn't work when some entries have no 
line number.
E.g.
list(co.co_lines):

(0, 2, 1)
(2, 4, None)
(4, 6, 1)

The instruction @ byte offset 4 starts an entry for line 1, but does not start 
line 1.

--

___
Python tracker 
<https://bugs.python.org/issue46817>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:

Let me give you an example.

#module eggs

eggs_var = 0 # a variable, maybe a counter or similar
EGGS_CONST # a constant

#module spam

import eggs

spam_var # Another variable

def foo():
use(eggs.EGGS_CONST)

-

We will want to treat `eggs.EGGS_CONST` as a constant.
To do that we need to be notified if `spam.eggs` or `eggs.EGGS_CONST` changes, 
but we do not want be notified whenever `spam.spam_var` or `eggs.eggs_var` 
changes.

This might not be necessary for us right now, but we will want to implement 
optimizations over larger regions than a single bytecode in 3.12.

--

___
Python tracker 
<https://bugs.python.org/issue46896>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45923] Improve performance of sys.settracing based tools.

2022-03-15 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30001
pull_request: https://github.com/python/cpython/pull/31908

___
Python tracker 
<https://bugs.python.org/issue45923>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-15 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29996
pull_request: https://github.com/python/cpython/pull/31901

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46944] Use FASTCALL calling convention in generator.throw

2022-03-11 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 304197b3820309e3ed695ff3e6a71461881a1728 by Kumar Aditya in 
branch 'main':
bpo-46944: use FASTCALL calling convention in generator.throw (GH-31723)
https://github.com/python/cpython/commit/304197b3820309e3ed695ff3e6a71461881a1728


--

___
Python tracker 
<https://bugs.python.org/issue46944>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46896] add support for watching writes to selected dictionaries

2022-03-11 Thread Mark Shannon


Mark Shannon  added the comment:

Another use of this is to add watch points in debuggers.

To that end, it would better if the callback were a Python object.

The overhead is relatively small if using the vectorcall protocol.
If the call overhead matters that much, there is something wrong as way too 
many callbacks are happening.

--

___
Python tracker 
<https://bugs.python.org/issue46896>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46896] add support for watching writes to selected dictionaries

2022-03-11 Thread Mark Shannon


Mark Shannon  added the comment:

You might not like global variables, they may not show up much in benchmarks, 
but people do use them. I suspect a lot of jupyter notebooks have quite a few 
global variables.


There should not be much of a slowdown for this code when watching `CONST`:

CONST = ... # watched
var = 0
for _ in range(LARGE_NUMBER):
var += 1
CONST = ... # trigger event.

--

___
Python tracker 
<https://bugs.python.org/issue46896>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-11 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29915
pull_request: https://github.com/python/cpython/pull/31817

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46896] add support for watching writes to selected dictionaries

2022-03-10 Thread Mark Shannon


Mark Shannon  added the comment:

There are three kinds of changes that we might want to watch (that I can think 
of right now):

1. Any change.
   Rather coarse and potentially expensive. Used by Cinder.
2. A new key being added (or a change to the keys version as a proxy).
   Useful for detect shadowing of builtins by module globals, would save the 
keys version check for the module dict in `LOAD_GLOBAL_BUILTINS` and a version 
check in some `LOAD_METHOD` specializations.
3. The value corresponding to a particular key.
   With this we could effectively convert both `LOAD_GLOBAL` specializations 
into a constant, given an effective way to de-optimize.


One way to support the three cases above would be to replace the dict version 
with a pointer to a data structure describing what it watched.
If the pointer is `NULL`, then nothing is being watched.
The data structure would need 2 bits to cover cases 1 and 2, and 1 bit (or 
byte) for each key in the dict keys (or case 1 could be implemented by setting 
all the bits for case 3).

--

___
Python tracker 
<https://bugs.python.org/issue46896>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-08 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 5498a61c7c25db6f9e76032aa9c5153d79e09889 by Brandt Bucher in 
branch 'main':
bpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742)
https://github.com/python/cpython/commit/5498a61c7c25db6f9e76032aa9c5153d79e09889


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46953] use FASTCALL for __import__ builtin

2022-03-08 Thread Mark Shannon


Mark Shannon  added the comment:

Serhiy, what is the advantage of __import__ being slower?

Not counting the argument clinic generated code, the PR doesn't add any code 
and improves the docstring.

--

___
Python tracker 
<https://bugs.python.org/issue46953>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45317] Document the removal the usage of the C stack in Python to Python calls

2022-03-07 Thread Mark Shannon


Mark Shannon  added the comment:

I don't think this needs to block the alpha release

--
priority: release blocker -> deferred blocker

___
Python tracker 
<https://bugs.python.org/issue45317>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-06 Thread Mark Shannon


Mark Shannon  added the comment:

Ronald, does PR 31658 fix your issue?

--
stage: patch review -> 

___
Python tracker 
<https://bugs.python.org/issue46903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-03-04 Thread Mark Shannon


Change by Mark Shannon :


--
stage: resolved -> 

___
Python tracker 
<https://bugs.python.org/issue46389>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46923] Implement stack overflow protection for supported platforms

2022-03-04 Thread Mark Shannon


New submission from Mark Shannon :

https://github.com/python/steering-council/issues/102 (definitely not PEP 651 
;))

We should implement efficient stack checks on those platforms that allow us to 
introspect stack extents.
Windows and posix systems allow us to do this.

C allows addresses of stack variables to be taken. This means that C stacks 
cannot be moved.
In theory they might be discontinuous, although I suspect that they are always 
contiguous.

My plan is to maintain a per-thread "safe region" of 32or 64k. We can check if 
the current stack pointer (or near enough) is in that region cheaply.
If we are not in that region, we can ask the O/S for a stack limit to determine 
a new "safe region". If we cannot find a safe region, then we raise a 
MemoryError.

Personally I'd prefer a new exception `StackOverflow` to `MemoryError` but, 
thanks to stackoverflow.com, it is now impossible for new programmers to do a 
web search to determine what a "stack overflow" is.
So, I guess MemoryError will have to do.

--
assignee: Mark.Shannon
messages: 414538
nosy: Mark.Shannon, gregory.p.smith
priority: normal
severity: normal
status: open
title: Implement stack overflow protection for supported platforms

___
Python tracker 
<https://bugs.python.org/issue46923>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46896] add support for watching writes to selected dictionaries

2022-03-04 Thread Mark Shannon


Mark Shannon  added the comment:

Why so coarse?

Getting a notification for every change of a global in module, is likely to 
make use the use of global variables extremely expensive.

```
var = 0

CONST = 1
def foo(...):
...
```

I may well want to be notified if `foo` or `CONST` gets modified, but 
performance could suffer badly if we make a callback every time `var` is 
changed.

--

What happens if a watched dictionary is modified in a callback?

--

How do you plan to implement this? Steal a bit from `ma_version_tag` or replace 
`ma_version_tag`?
If you replace `ma_version_tag` this could actually speed things up a tad.

You'd probably need a PEP to replace PEP 509, but I think this may need a PEP 
anyway.

--

___
Python tracker 
<https://bugs.python.org/issue46896>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong

2022-03-04 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46311>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-04 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 586b24d3be1aec5d2568b070a249b4d75e608782 by Brandt Bucher in 
branch 'main':
bpo-46841: Fix error message hacks in `GET_AWAITABLE` (GH-31664)
https://github.com/python/cpython/commit/586b24d3be1aec5d2568b070a249b4d75e608782


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46781] Tracing: c_return doesn't report the result

2022-03-04 Thread Mark Shannon


Mark Shannon  added the comment:

This is an API change.

I agree that the API is not what it should be, but we can't change it without 
breaking an unknown amount of 3rd party code that uses it.

--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue46781>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46911] Early tracing has lineno=None for modules

2022-03-04 Thread Mark Shannon


Mark Shannon  added the comment:

This is a bit of a tricky one.

The problem is that the line number for an instruction is used for two purposes.
1. To calculate the line number in frame.f_lineno for tracebacks and events
2. By dis to determine which lines are present and where they start.

If we set the lineno for the initial RESUME instruction in a module, we break 
dis and coverage for modules that do not have code on line 1.

If we add an explicit line-start table, we would be able to fix this, as the 
RESUME would have a line number for case 1, but wouldn't start a line, thus not 
breaking dis.

An explicit line-start table has other advantages, so we probably will 
implement it, but maybe not until 3.12.

Ned,
Would it make sense in coverage.py to ignore "call" events when doing coverage, 
and only use "line" events?
All the traces in your example are from "call" events.

--

___
Python tracker 
<https://bugs.python.org/issue46911>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-04 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 03c2a36b2bd2d4469160d1607619ee144175d753 by Mark Shannon in 
branch 'main':
bpo-46903: Handle str-subclasses in virtual instance dictionaries. (GH-31658)
https://github.com/python/cpython/commit/03c2a36b2bd2d4469160d1607619ee144175d753


--

___
Python tracker 
<https://bugs.python.org/issue46903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46908] Debugger jumps to a wrong instruction in for loop

2022-03-03 Thread Mark Shannon


Mark Shannon  added the comment:

Which debugger? Which version of Python?

Please provide all the steps required to reproduce, otherwise there is little 
we can do.

--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue46908>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-03-03 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46389>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46845] dict: Use smaller entry for Unicode-key only dict.

2022-03-03 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29777
pull_request: https://github.com/python/cpython/pull/31659

___
Python tracker 
<https://bugs.python.org/issue46845>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46675] Allow more than 16 items in split-keys dicts and "virtual" object dicts.

2022-03-03 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46675>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-03 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +29776
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31658

___
Python tracker 
<https://bugs.python.org/issue46903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-03-03 Thread Mark Shannon


Mark Shannon  added the comment:

Ned, is this fixed for you now?

--

___
Python tracker 
<https://bugs.python.org/issue46389>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-03 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46891>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-03 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 751c9ed801ad1189272ca10f0749bfc9d49b5038 by Mark Shannon in 
branch 'main':
bpo-46891: Fix creating a new instance of a module subclass with slots 
(GH-31643)
https://github.com/python/cpython/commit/751c9ed801ad1189272ca10f0749bfc9d49b5038


--

___
Python tracker 
<https://bugs.python.org/issue46891>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

It's not an UNPACK_SEQUENCE slowdown, it's a silly benchmark ;)

https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_unpack_sequence/run_benchmark.py#L6

What I *think* is happening is that the inline cache takes the size of the 
function (in code units) from about 4800 to about 5200, crossing our threshold 
for quickening (currently set to 5000).

When we quicken in-place, there will be no need for a threshold and this issue 
will disappear. We should probably up the threshold for now, just to keep the 
charts looking good.

--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

Good to know, although "deferred blocker" is somewhat vague about when it is 
deferred until.

OOI, does it become a "blocker" again once you've done the alpha release, or 
what stops it being deferred past the beta or even the final release?

--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +29763
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31643

___
Python tracker 
<https://bugs.python.org/issue46891>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

Dennis, thanks for bisecting this.

--

___
Python tracker 
<https://bugs.python.org/issue46891>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Mark Shannon


Change by Mark Shannon :


--
assignee:  -> Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue46891>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

We should be done with this by early next week, if you can wait.

--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

Is there some way to mark something as not blocking an alpha release, but 
blocking a beta release?

Everything is working at the moment, but not so efficiently.

--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

I've outlined the requirements for a frame stack API at 
https://github.com/faster-cpython/ideas/issues/309.

The problem with adding an API for PyFrameObject (beyond simple getters) is 
that it makes assumptions about the frame stack that aren't valid.

A stack of frames is not just a linked list of frames. It never was, and it 
certainly isn't now.

--

___
Python tracker 
<https://bugs.python.org/issue40421>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 3b0f1c5a710eff289dc44bec972dbaea353cc54f by Mark Shannon in 
branch 'main':
bpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618)
https://github.com/python/cpython/commit/3b0f1c5a710eff289dc44bec972dbaea353cc54f


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong

2022-03-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset c60e6b6ad7aaf9c72035ff9fb1575e2710aeb4b4 by Mark Dickinson in 
branch 'main':
bpo-46311: Clean up PyLong_FromLong and PyLong_FromLongLong (GH-30496)
https://github.com/python/cpython/commit/c60e6b6ad7aaf9c72035ff9fb1575e2710aeb4b4


--

___
Python tracker 
<https://bugs.python.org/issue46311>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-03-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 7820a5897e7762df23bff1cbe749652130654a08 by Brandt Bucher in 
branch 'main':
bpo-46841: Use inline caching for `COMPARE_OP` (GH-31622)
https://github.com/python/cpython/commit/7820a5897e7762df23bff1cbe749652130654a08


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-28 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29743
pull_request: https://github.com/python/cpython/pull/31618

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-28 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 4558af5a8f8e56a9b0dc11f6e834c47e0fd05f9e by Mark Shannon in 
branch 'main':
bpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)
https://github.com/python/cpython/commit/4558af5a8f8e56a9b0dc11f6e834c47e0fd05f9e


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-28 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 424ecab494d538650ba34937cdd710094ccb2275 by Brandt Bucher in 
branch 'main':
bpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)
https://github.com/python/cpython/commit/424ecab494d538650ba34937cdd710094ccb2275


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-25 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29697
pull_request: https://github.com/python/cpython/pull/31575

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46808] remove NEXT_BLOCK() from compile.c

2022-02-25 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset c579243eb62d3182c84004cd72dcf6ef59100643 by Irit Katriel in 
branch 'main':
bpo-46808: remove NEXT_BLOCK() from compile.c (GH-31448)
https://github.com/python/cpython/commit/c579243eb62d3182c84004cd72dcf6ef59100643


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue46808>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-25 Thread Mark Shannon


Change by Mark Shannon :


--
priority: normal -> release blocker

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-25 Thread Mark Shannon


Mark Shannon  added the comment:

Making this a release blocker, as we really cannot leave this half finished for 
the release.

Shouldn't be a problem, as we'll have it done in a week or so.

--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-25 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 0f41aac109c45aa468c432f798947c54d4178b3d by Brandt Bucher in 
branch 'main':
bpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)
https://github.com/python/cpython/commit/0f41aac109c45aa468c432f798947c54d4178b3d


--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-02-25 Thread Mark Shannon


Mark Shannon  added the comment:

Stefan,

f_lineno can be None for some opcodes, but there shouldn't be trace events if 
it is.

E.g.
>>> def f():
... try:
...  1/0
... finally:
...  pass
...

>>> list(f.__code__.co_lines())
[(0, 2, 1), (2, 4, 2), (4, 12, 3), (12, 16, 5), (16, 18, None), (18, 26, 5)]

Note that the bytecode at offset 16 has no line number, but there should be no 
events for it.


BUT, before you try and fix your tracing emulation, I repeat my plea.

Please stop trying to mimic CPython internals, and ask for the APIs that you 
need.

--

___
Python tracker 
<https://bugs.python.org/issue46389>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45107] Improve LOAD_METHOD specialization

2022-02-24 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 2a6ece572ca38f989fca66f4c053cb16550bccd4 by Mark Shannon in 
branch 'main':
bpo-45107: Specialize `LOAD_METHOD` for instances with dict. (GH-31531)
https://github.com/python/cpython/commit/2a6ece572ca38f989fca66f4c053cb16550bccd4


--

___
Python tracker 
<https://bugs.python.org/issue45107>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode

2022-02-24 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset a52d2528a405c1e2bfeb6470cb3313a5338dc45f by Dennis Sweeney in 
branch 'main':
bpo-46823: Implement LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE superinstruction 
(GH-31484)
https://github.com/python/cpython/commit/a52d2528a405c1e2bfeb6470cb3313a5338dc45f


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue46823>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-24 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29673
pull_request: https://github.com/python/cpython/pull/31552

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46841] Inline bytecode caches

2022-02-24 Thread Mark Shannon


Mark Shannon  added the comment:

We need to decide what to do about dis.

I don't think we should have a `show_cache` option, as the caches are 
meaningless junk without quickening (maybe we should drop the CACHE opcode, and 
just use zeroes).

Instead we should have a `show_quickened` option, to show the quickened form, 
which we need to make clear is very much implementation defined.
E.g. Cinder might show the machine code as well.

That way, we can present the cache information as extra data on the quickened 
form, rather than junk instructions.

--

___
Python tracker 
<https://bugs.python.org/issue46841>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45107] Improve LOAD_METHOD specialization

2022-02-23 Thread Mark Shannon


Change by Mark Shannon :


--
nosy: +Mark.Shannon
nosy_count: 1.0 -> 2.0
pull_requests: +29655
pull_request: https://github.com/python/cpython/pull/31531

___
Python tracker 
<https://bugs.python.org/issue45107>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45885] Specialize COMPARE_OP

2022-02-23 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 375a56bd4015596c0cf44129c8842a1fe7199785 by Brandt Bucher in 
branch 'main':
bpo-45885: Don't un-adapt `COMPARE_OP` when collecting stats (GH-31516)
https://github.com/python/cpython/commit/375a56bd4015596c0cf44129c8842a1fe7199785


--

___
Python tracker 
<https://bugs.python.org/issue45885>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-23 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 424023efee5b21567b4725015ef143b627112e3c by Brandt Bucher in 
branch 'main':
bpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511)
https://github.com/python/cpython/commit/424023efee5b21567b4725015ef143b627112e3c


--

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-22 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29626
pull_request: https://github.com/python/cpython/pull/31496

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-21 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 59585d6b2ea50d7bc3a9b336da5bde61367f527c by Mark Shannon in 
branch 'main':
bpo-46329: Streamline calling sequence a bit. (GH-31465)
https://github.com/python/cpython/commit/59585d6b2ea50d7bc3a9b336da5bde61367f527c


--

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46817] Add a line-start table to the code object.

2022-02-21 Thread Mark Shannon


New submission from Mark Shannon :

Computing whether an instruction is the first on a line (for tracing) in the 
interpreter is complicated and slow. Doing it in the compiler should be simpler 
and has no runtime cost.

Currently we decide if the current instruction is the first on a line, by using 
the `co_lines` table, but if the previous instruction executed was a jump from 
the same line over a block of instructions with different line number(s) then 
we can get this wrong.

This doesn't seem to a problem now, but could be with either: 
Specialization of FOR_ITER inlining generators, or
Compiler improvements leading to different code layout.


The table is only one bit per instruction, so shouldn't be a problem in terms 
of space.

--
components: Interpreter Core
messages: 413651
nosy: Mark.Shannon, iritkatriel
priority: normal
severity: normal
status: open
title: Add a line-start table to the code object.
type: behavior
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue46817>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-21 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29595
pull_request: https://github.com/python/cpython/pull/31465

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-18 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset cf345e945f48f54785799390c2e92c5310847bd4 by Mark Shannon in 
branch 'main':
bpo-46329: Change calling sequence (again) (GH-31373)
https://github.com/python/cpython/commit/cf345e945f48f54785799390c2e92c5310847bd4


--

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

2022-02-18 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset e2c28616ce6c3cdb1013c415125220a0b86b86a1 by Nikita Sobolev in 
branch 'main':
bpo-46709: check eval breaker in specialized `CALL` opcodes (GH-31404)
https://github.com/python/cpython/commit/e2c28616ce6c3cdb1013c415125220a0b86b86a1


--
nosy: +Mark.Shannon

___
Python tracker 
<https://bugs.python.org/issue46709>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46724] Odd Bytecode Generation in 3.10

2022-02-18 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset c3ce7781e3afe6f2dec5eef8e87fd5a664519ae9 by Saul Shanabrook in 
branch 'main':
bpo-46724: Fix dis support for overflow args (GH-31285)
https://github.com/python/cpython/commit/c3ce7781e3afe6f2dec5eef8e87fd5a664519ae9


--

___
Python tracker 
<https://bugs.python.org/issue46724>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46760] test_dis should test the dis module, not everything else

2022-02-16 Thread Mark Shannon


Change by Mark Shannon :


--
nosy: +brandtbucher, iritkatriel

___
Python tracker 
<https://bugs.python.org/issue46760>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   9   10   >