Why I cannot achieve 100% accuracy in my simple training data with CART model? For experimental purpose, I want to intentionally over-fit my training data with CART. But with rpart in R. I cannot achieve 100% accuracy. Why?
table(d$classes,predict(fit,d, type="class"))   
       1    2
  1 2544   21
  2   33 2402

The data is generated from 2 Gaussian, so, there is no chance the two data points with different class label would overlap, and we set the complexity parameter to 0 and min split is 1. As discussed in the comment. I tried every combinations with the control (not shown in the code), but not helpful.
Why there are still pruning happend on the tree? Or why the tree stop to grow to achivive 100% accuracy?


Code
library(mlbench)
library(rpart)
set.seed(0)
graphics.off()
par(mfrow=c(2,2))
d=mlbench.2dnormals(5000,sd=3)

ctr=rpart.control(cp=0,minsplit = 1)
fit=rpart(classes~.,d,control=ctr)
table(d$classes,predict(fit,d, type="class"))

gd=seq(-8,8,0.1)
dnew=expand.grid(x.1=gd,x.2=gd)

plot(d,xlim=c(-8,8),ylim=c(-8,8))
grid()
plot(dnew$x.1,dnew$x.2,col=predict(fit,dnew, type="class"))
plotcp(fit)
grid()

 A: I figured out the reason: it is the maxdepth problem as suggested by @usεr11852. 
We thought max depth is $30$ is a big enough, since $2^{30}$ is a huge number. However, in many cases, depth $30$ is not enough since the tree is not a complete binary tree, which has $2^n$ terminal nodes, if we have $n$ layer.

Here is the verification:
There is a hidden function in rpart can produce the depth of the tree. As suggested in this post.
nodes=as.numeric(rownames(fit$frame))
max(rpart:::tree.depth(nodes))

Using this function we can get the tree size is $30$ !! And if we plot it, it also verifies the results and from the figure we can see, the tree is far away from complete binary tree.


What we learned from this experiment:
RPART documentation on max depth says: 

Set the maximum depth of any node of the final tree, with the root node counted as depth 0. Values greater than 30 rpart will give nonsense results on 32-bit machines.

This may not be accurate, since the tree can be far away from complete binary tree, so, values than 30 will make since in many cases !! and it should allow user to set a bigger number
