Ticket #4111 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[with patch, positive review] move basic types to new coercion model

Reported by: robertwb Owned by: robertwb
Priority: major Milestone: sage-3.1.3
Component: coercion Keywords:
Cc: Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

Description

This ticket depends on #4058

Attachments

4111-coerce-QQ.patch Download (23.3 KB) - added by robertwb 2 years ago.
4111-coerce-RR.patch Download (19.0 KB) - added by robertwb 2 years ago.
4111-coerce-simplify.patch Download (21.9 KB) - added by robertwb 2 years ago.
4111-coerce-CC.patch Download (16.7 KB) - added by robertwb 2 years ago.
4111-coerce-QQ.2.patch Download (23.3 KB) - added by robertwb 2 years ago.
against 3.1.3.alpha1
4111-coerce-RR.2.patch Download (18.6 KB) - added by robertwb 2 years ago.
against alpha 3.1.3.alpha1

Change History

Changed 2 years ago by robertwb

  • summary changed from [with patch, needs review] move QQ to new coercion model to [with patch, needs review] move basic types to new coercion model

Changed 2 years ago by AlexGhitza

  • cc AlexGhitza added

Changed 2 years ago by robertwb

Changed 2 years ago by robertwb

Changed 2 years ago by robertwb

Changed 2 years ago by robertwb

Changed 2 years ago by robertwb

Patches rebased against 3.1.2.

Changed 2 years ago by mhansen

  • summary changed from [with patch, needs review] move basic types to new coercion model to [with patch, positive review] move basic types to new coercion model

Looks good and passes tests for me. Excellent work getting this patch made!

Changed 2 years ago by mabshoff

Robert,

unfortunately I cannot get the patches to apply cleanly and there are various rejects. Sage 3.1.3.alpha1 should be out in a few hours. Could you please rebase them against that release and I will make sure they go in first.

Cheers,

Michael

Changed 2 years ago by robertwb

Argh... I just rebased these against 3.1.2...

OK, I'll rebase them again (shouldn't be too hard).

Changed 2 years ago by robertwb

I got a single reject in 4111-coerce-RR.patch, which I resolved, and some fuzz in 4111-coerce-QQ.patch, which I'm reposting. These should all apply fine against 3.1.3.alpha1 now.

Changed 2 years ago by robertwb

against 3.1.3.alpha1

Changed 2 years ago by robertwb

against alpha 3.1.3.alpha1

Changed 2 years ago by robertwb

The order to apply is QQ, RR, simplify, CC.

Changed 2 years ago by mabshoff

Robert,

I merged the four patches and the only issue is the following:

sage -t -long devel/sage/sage/rings/real_mpfr.pyx           
**********************************************************************
File "/scratch/mabshoff/release-cycle/sage-3.1.3.alpha2/tmp/real_mpfr.py", line 1900:
    sage: RR(-1.234567)._pari_()
Expected:
    -1.2345670000000000000
Got:
    -1.2345670000000000001
**********************************************************************
1 items had failures:
   1 of  11 in __main__.example_58
***Test Failed*** 1 failures.
For whitespace errors, see the file /scratch/mabshoff/release-cycle/sage-3.1.3.alpha2/tmp/.doctest_real_mpfr.py
         [10.8 s]

I don't changing the doctest is the solution here since the "Real Number Inputs Improved" patch from 3.1.2 was supposed to fix this. Or am I completely wrong here? Either way: feel free to add a patch here or in case it is something more than non-trivial open another ticket.

Cheers,

Michael

Changed 2 years ago by mabshoff

  • status changed from new to closed
  • resolution set to fixed

Merged 4111-coerce-simplify.patch, 4111-coerce-CC.patch, 4111-coerce-QQ.2.patch and 4111-coerce-RR.2.patch in Sage 3.1.3.alpha2

Changed 2 years ago by robertwb

Oh, I think I know what the issue is (we have two real fields of 53 bits prec). I'll post a patch that addresses this.

sage: (1.2).parent() is RR
 False

Changed 2 years ago by AlexGhitza

Also, the patches at #4096 (which I will rebase against 3.1.3.alpha1 as soon as I have built it) will take care of this.

Changed 2 years ago by robertwb

Actually, after those patches I get

sage: 1.2.parent() is RR
True

Sit looks like a pari issue for sure. For example, I get

sage: (-1.23456)._pari_()
-1.2345600000000000001

which isn't using RR.__call__ at all.

Changed 2 years ago by mabshoff

  • cc AlexGhitza removed

I opened #4199 to make sure the issue does not escape us. I will test the pari patch and see if it fixes the problem.

Cheers,

Michael

Note: See TracTickets for help on using tickets.