_CHECK_FUNCTION interferes with partial evaluation
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
Feature or enhancement
Proposal:
A reminder of how _CHECK_FUNCTION looks like:
tier2 op(_CHECK_FUNCTION, (func_version/2 -- )) {
assert(PyStackRef_FunctionCheck(frame->f_funcobj));
PyFunctionObject *func = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(frame->f_funcobj);
DEOPT_IF(func->func_version != func_version);
}
frame->f_funcobj becomes invalid once we start inlining functions. Thus we should "burn in" the function object version to be checked whenever possible, to not interfere with inlining and partial evaluation.
An added benefit is that the "burned in" version is also cheaper as it doesn't have to read from the frame struct, rather reading from the instruction itself in the JIT.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-126856
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece pela operação tier2 _CHECK_FUNCTION mostrada na issue e examine como frame->f_funcobj é usado quando as funções são inlined. Revise o PR vinculado gh-126856 e determine se a versão da função pode ser gravada na instrução sem interferir na avaliação parcial; considera-se concluído quando a verificação da versão não depender mais, quando possível, da referência invalidada ao frame.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- c, python
- Domínio
- backend, compilers, performance
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100