Opened 17 months ago

Closed 9 months ago

#14324 closed task (fixed)

Consider deprecating STM invariant mechanism

Reported by: bgamari Owned by:
Priority: normal Milestone: 8.6.1
Component: Compiler Version: 8.2.1
Keywords: GHCProposal Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #14310 Differential Rev(s): Phab:D4372, Phab:D4760
Wiki Page:

Description (last modified by bgamari)

fryguybob and I were recently discussing the STM invariant mechanism (e.g. Control.Monad.STM.check). This mechanism is, presumably, intended to expose problems from odd interleavings of transactions. However, fryguybob pointed out that the implementation currently takes so many locks that it very likely prevents these odd interleavings from occurring.

In addition,

  • the implementation doesn't handle nested STM invariants correctly (#7930)
  • the locking behavior of the implementation was, until very recently, utterly wrong (#14310)
  • the feature introduces quite a bit of complexity in the RTS
  • the interface has essentially no users, as evidenced by a Hackage search and the fact that #14310 went unnoticed for years

All of this raises the question: Is the STM invariants feature really where we want to spend our complexity budget? Perhaps it is time for this feature to quietly pass (after an appropriate deprecation period, of course).

Change History (10)

comment:1 Changed 17 months ago by bgamari

Description: modified (diff)

comment:2 Changed 17 months ago by simonpj

All of this raises the question: Is the STM invariants feature really where we want to spend our complexity budget?

I think that's an excellent question. I suspect you are right. If we want to go that way we should advertise our (provisional) intention on ghc-users to see if anyone pops up.

comment:3 Changed 17 months ago by bgamari

I've opened a GHC proposal.

comment:4 Changed 17 months ago by bgamari

fryguybob notes that he has a commit removing the feature: https://github.com/fryguybob/ghc/commit/38befad8a05406f1c553aba1f5e42929b68eba13

comment:5 Changed 13 months ago by bgamari

The proposal has been accepted. I will add the appropriate deprecation pragmas in base-4.11.0.0 noting that removal will happen in three releases (presumably GHC 8.10).

comment:6 Changed 13 months ago by bgamari

Differential Rev(s): Phab:D4372
Status: newpatch

Deprecation performed in Phab:D4372.

comment:7 Changed 11 months ago by bgamari

Resolution: fixed
Status: patchclosed

comment:8 Changed 9 months ago by RyanGlScott

Keywords: GHCProposal added

comment:9 Changed 9 months ago by bgamari

Differential Rev(s): Phab:D4372Phab:D4372, Phab:D4760
Resolution: fixed
Status: closednew

We will follow-through with removal in 8.6.1. I've done this in Phab:D4760.

comment:10 Changed 9 months ago by bgamari

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.