Since the start of 2010, 26 batsmen have scored 3000 or more Test runs. Twenty-three of them average 40 or more. Among the three who don't are two batsmen who distinguished themselves in the recently concluded Pakistan-Sri Lanka Tests. Dimuth Karunaratne made 306 runs in the series, including a marathon 196 in Dubai and was Sri Lanka's top run scorer, while Asad Shafiq topped the run charts for Pakistan with 183, including a magnificent fourth-innings 112 in Dubai.

However, neither batsman has consistently churned out runs consistently at the Test level, which is why they languish at the bottom of that list. Karunaratne averaged a meagre 33.34 in 20 Tests in 2015 and '16, before turning the corner this year, scoring 940 runs at an average of 47 in 2017.

Shafiq had a stellar 2015, scoring 706 runs in 13 innings at 54.3, but he has struggled for any sort of consistency over the last 14 months: in 15 Tests between July 2016 and September 2017 (excluding the Dubai game), he managed just 834 runs at 30.88. Though he did get that magnificent 137 in the fourth innings of the Gabba Test during this period, he was also frustratingly inconsistent, getting dismissed below 20 sixteen times in 28 innings; he made almost as many ducks (six) as he did 50-plus scores (seven) in this period. Even with his 112 in the Dubai Test, Shafiq's average in 2017 is only 25.81 from 11 innings, numbers that do scant justice to his talent.

There is another similarity between the career numbers of Shafiq and Karunaratne: their distribution of runs and averages across the four innings of a Test. Both have good numbers in the first innings and a dip in the second - which is far more prominent for Karunaratne - but the surprising stat is the fourth-innings average: both average more in the fourth innings than they do in any of the other three. That is a pretty rare phenomenon, given that run-scoring is usually toughest in the last innings. In fact, among the 27 players who have batted at least 15 times in the last innings of Tests since the start of 2010, both Karunaratne and Shafiq are in the top eight in terms of average. Neither has an average that is propped up too much by not-outs - Karunaratne has three in 15, and Shafiq three in 17 - which is why, in terms of runs per innings, they move up to the top five among these 27 batsmen. That is quite a contrast to their overall averages during this period, where they languish among the bottom three out of 26 batsmen. (Misbah-ul-Haq leads in terms of fourth-innings average, with 67.8, but he has remained not-out in 11 of 21 innings; in terms of runs per innings, he is in 12th place with an RPI of 32.29.)

Highest runs per inns in 4th inns of Tests since Jan 2010 (Min 15 inns)
Player Inns Runs Ave Runs/inn
 KS Williamson  15  669  66.90  44.60
 V Kohli  17  737  61.41  43.35
 DA Warner  23  907  43.19  39.43
 Asad Shafiq  17  635  45.35  37.35
 FDM Karunaratne  15  558  46.50  37.20
 AD Mathews  17  626  52.16  36.82
 DM Bravo  19  692  46.13  36.42
 Younis Khan  22  790  49.37  35.91

In the fourth innings, Karunaratne and Shafiq average significantly more than batsmen like Alastair Cook (36.93), Cheteshwar Pujara (36.41), Joe Root (34.26), Steven Smith (32.52) and Azhar Ali (26.25). That suggests an ability to perform in tough conditions, which makes it even more infuriating that their career averages are so low (in relative terms, at least). In fact, Karunaratne and Shafiq are among only 13 batsmen in Test history who have a higher average in the fourth innings than in other innings (among those who batted 15 or more times in each innings and scored 3000-plus career runs).

Batsmen averaging more in 4th inns than other inns (Min 15 inns in each; 3000 career runs)*
Batsman 4th inns 3rd inns 2nd inns 1st inns
  Dimuth Karunaratne  46.50  40.41  19.91  44.23
  Asad Shafiq  45.36  39.10  34.06  44.08
  Rod Marsh  28.64  25.15  25.17  28.12
  Hansie Cronje  39.83  37.04  35.19  35.84
  Mark Butcher  41.42  31.26  34.67  34.14
  Alvin Kallicharran  46.53  39.40  44.90  46.48
  Angelo Mathews  57.50  49.75  41.35  39.65
  Arjuna Ranatunga  47.64  35.07  38.38  30.17
  Kane Williamson  66.90  44.10  66.46  41.06
  Gordon Greenidge  53.19  42.78  37.59  50.10
  Mike Atherton  41.67  32.12  38.02  40.86
  Geoff Boycott  58.76  47.39  42.60  47.97
  Graeme Smith  51.97  42.30  48.81  50.47
* Reverse-sorted by career runs

Both these batsmen have made significant contributions in their teams' second innings (the third or fourth innings of a Test). Apart from Shafiq's 137 in Brisbane and 112 in Dubai, he also has three hundreds in the third innings of Tests (though a couple of them were in matches that Pakistan lost by an innings). Karunaratne has four hundreds in the third innings, including a monumental 152 against New Zealand in Christchurch, an innings that lasted over eight hours but eventually went in vain. (Another similarity between the two is that both have scored more Test hundreds in defeats than in wins: 5-4 for Shafiq; 4-3 for Karunaratne.)

These runs in losses for both players indicate a tendency to often play the lone hand in the second innings, with not much support from other batsmen. Their first- and second-innings numbers in Test defeats are remarkably similar: they both average around 19 in the first innings, and more than 41 in the second.

Also, when they have come in the bat in the second innings with their teams facing deficits, their stats are among the best when compared with all batsmen from their country. (These situations include: batting in the third innings with a first-innings deficit or following on, or batting in the fourth innings facing a target. This also includes cases when the team is chasing a low target and isn't under much pressure, but the percentage of such runs to the overall aggregate will be fairly low for most batsmen.)

Taking a cut-off of 750 runs for batsmen coming in to bat facing such deficits, Shafiq's average is the highest among all Pakistan batsmen, while Karunaratne is second among Sri Lanka's batsmen, next only to the incomparable Kumar Sangakkara. Again, their averages, as well as the rate at which they make 50-plus scores in such situations, are remarkably similar.

Top ave in 2nd inns for Pak when coming in facing a deficit (Min 750 runs)
Batsman Runs Ave 100s/ 50s Inns per 50+
 Asad Shafiq  990  47.14  4/6  2.40
 Saleem Malik  1225  45.37  3/8  3.09
 Mohammad Yousuf  1606  44.61  2/12  3.00
 Hanif Mohammad  1230  43.93  2/7  3.33
 Younis Khan  2582  43.76  8/18  2.73
Top ave in 2nd inns for SL when coming in facing a deficit (Min 750 runs)
Batsman Runs Ave 100s/ 50s Inns per 50+
 Kumar Sangakkara  2995  50.76  8/23  2.23
 Dimuth Karunaratne  1345  48.04  3/10  2.38
 Angelo Mathews  1167  44.88  1/9  3.30
 Asanka Gurusinha  816  42.95  4/4  3.00
 Sanath Jayasuriya  1932  42.00  5/14  3.00

Pakistan and Sri Lanka have invested plenty in these two players, and both have enough Test-match experience under their belts now - Shafiq has played 58 Tests to Karunaratne's 44. Shafiq is also two years older, and made his Test debut almost exactly two years before Karunaratne did. Now 31 and 29, both Shafiq and Karunaratne are approaching the time of life that is usually the most prolific for batsmen. For the sake of Pakistan and Sri Lankan cricket, that theory will hopefully hold good for these two as well.

With inputs from Shiva Jayaraman.

S Rajesh is stats editor of ESPNcricinfo. @rajeshstats.