Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 653
    • Issues 653
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPy
  • pypypypy
  • Issues
  • #2076

Closed
Open
Created Jul 06, 2015 by Bitbucket Importer@bitbucket_importerMaintainer

Pyrlang float datatype dead in virtualiazble array when switched out with bridge

Created originally on Bitbucket by hrc706 (Ruochen Huang)

Hi all,

The float type in Pyrlang is simply a wrapper class of RPython float type.

My test Erlang script tried to do something like sum(list(3.1415926,3.1415926,3.1415926...)), so the JIT generated a trace that extract one element from the list, and add it into the sum result, and then the next element...

On the other hand, there is a yield counter in dispatch loop, around the bytecode IS_NONEMPLY_LIST (or any other if-statement-like bytecode instruction), when the counter reduced to 0, the process (dispatch loop) will be switched out.

I have also annotated the X_Register as virtualiazble to improve the accessing performance.

My situation is that, when I execute the test Erlang script with large scale, the switched-out-path will be recorded as a bridge, which ended with a finish(Constr(ptr35) ...), and the computing result will be wrong. (say computing a 1000000 length list, the result should be 3141592.65359 but I only got 18.849556).

I also tried Erlang Integer for the same function, it worked well.

Tried executing without scheduler, worked well.

Tried less scale so the switched-out-path will not be recorded as bridge, worked well.

Tried removing the virtualiable in X Register, worked well.

You can reproduce the bug by:

  • clone or pull my repository from https://hrc706@bitbucket.org/hrc706/pyrlang.git.

  • rpython -Ojit targettest.py

  • ./targettest-c test_beam/test_pi.beam test_s 1000000 (will output 18.849556)

  • ./targettest-c test_beam/test_pi.beam test_s 100000 (will output 314159.265359, as expected)

  • ./targettest-c test_beam/test_pi.beam test_si 100000 (executing the test function with integers, always output the correct result)

You can also check the Erlang script source at test_beam/test_pi.erl if you like :-).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking